adapap

Zero Width

Jan 10th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import pyperclip as clip
  2. from random import randint
  3. def add_zeros(s):
  4. if len(s) < 1:
  5. print('')
  6. return
  7. result = ''
  8. for c in list(s):
  9. count = randint(2,8)
  10. result += ' ' + ('\u200b' * count)
  11. clip.copy(result)
  12. print('Copied to clipboard.\n{} characters added to form {} words.'.format(len(result) - len(s), len(s)))
  13.  
  14. if __name__ == '__main__':
  15. inp = input('Enter a word count or paste spaces: ')
  16. if inp.isnumeric():
  17. add_zeros(' ' * int(inp))
  18. else:
  19. add_zeros(inp)
Advertisement
Add Comment
Please, Sign In to add comment