Windows 10 Linux subsystem - Python - String to computer clipboard

Viewed 742

I have a python script where I want to place a string in the computer's clipboard. I have this working in Linux, Mac, and previously in Windows using cygwin. I had to modify one line of code to get it working in the respective systems. I can't get a string copied to the clipboard on Windows 10's native Linux subsystem. The line below causes error: sh: 1: cannot create /dev/clipboard: Permission denied. Any idea how to modify this line?

os.system("echo hello world > /dev/clipboard")
3 Answers
Related