Skip to content

Instantly share code, notes, and snippets.

@VeryCB
Created May 30, 2014 02:33
Show Gist options
  • Save VeryCB/9c447b541c6dc3a5b8f6 to your computer and use it in GitHub Desktop.
Save VeryCB/9c447b541c6dc3a5b8f6 to your computer and use it in GitHub Desktop.
insert spaces between Chinese characters and copy to clipboard
import os
while True:
join_by = ' ' * 3
content = raw_input('say something: ')
content_list = [content[i:i+3] for i in range(0, len(content), 3)]
output = join_by.join(content_list)
os.system("echo '%s' | pbcopy" % output)
print 'copied "%s" to clipboard, now you can paste!' % output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment