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")
/dev/clipboard
in linux, that's something that only exists in cygwin. Usually programs likexclip
orxsel
are used to access the X server clipboard on linux, but I'm relatively sure that won't work on the windows linux subsystem.