Reputation: 5512
How can i directly run the contents of the clipboard, I tried using the command python pbpaste
but it said python: can't open file 'pbpaste': [Errno 2] No such file or directory does the code have to be contained in a file to run it?
Upvotes: 0
Views: 387
Reputation: 126827
Since pbpaste
produces its output on the standard output and Python can take its input from the standard input, you can simply pipe them:
pbpaste | python
Upvotes: 3