I just need a python script that copies text to the clipboard.
After the script gets executed i need the output of the text to be pasted to another source. Is it possible to write a python script that does this job?
I just need a python script that copies text to the clipboard.
After the script gets executed i need the output of the text to be pasted to another source. Is it possible to write a python script that does this job?
This is the only way that worked for me using
Python 3.5.2
plus it's the easiest to implement w/ using the standardPyData
suiteShout out to https://stackoverflow.com/users/4502363/gadi-oron for the answer (I copied it completely) from How do I copy a string to the clipboard on Windows using Python?
I wrote a little wrapper for it that I put in my
ipython
profile <3GTK3:
PyQt5:
On macOS, use
subprocess.run
to pipe your text topbcopy
:It will copy "hello world" to the clipboard.
See Pyperclip. Example (taken from Pyperclip site):
Also, see Xerox. But it appears to have more dependencies.
I try this clipboard 0.0.4 and it works well.
https://pypi.python.org/pypi/clipboard/0.0.4