Reputation: 1
I used
pip install pyperclip
to install the package. when I use it in a script, eg.:
import pyperclip
pyperclip.copy('somestring')
pyperclip.paste()
it would return 'somestring'
my issue is that I wanna use it to paste elsewhere but the shell, it acts like there's nothing to paste. What could be wrong? (I use linux system)
Upvotes: 0
Views: 561
Reputation: 1
I was having the same issue on a Windows computer, perhaps the module is not supported on other things besides the python IDE as pyperclip.paste() would not work on anything other than that. My workaround was to
import pyautogui
hover over the spot you want to paste. Then in the terminal or IDE use:
pyautogui.displayMousePosition()
to display your mouse's x and y coordinates, then use those coordinates with:
pyautogui.click(x, y)
pyautogui.hotkey('ctrl', 'v')
to literally ctrl+v.
Upvotes: 0
Reputation: 1
I am facing same issue try pip3 install may be it work for you
if not use xclip
. this is werid shell command
import subprocess
subprocess.call(["xclip","-o"])
Upvotes: 0