Created
August 7, 2017 18:37
-
-
Save patrickserrano/ed70d73c5c73ed4ac385ebccc01af104 to your computer and use it in GitHub Desktop.
Python script to take input broken by new lines and returns as a comma separated string with each element wrapped in double quotes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
buffer = '' | |
while True: | |
line = input() | |
if not line: break | |
buffer += '"' + line + '",' | |
cmd = 'echo '+buffer[:-1].strip()+'|clip' | |
subprocess.check_call(cmd, shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment