Pyperclip does not persist if called from script
See original GitHub issueI want to store something into the clipboard via a python script.
It’s basically just pyperclip.copy('text'). I’m using Fedora 21 with AwesomeWM. I read here that a clipboard manager is needed to store it permanent in the clipboard. I installed parcellite. It now works, if I use it in an terminal, via
$python
$>>> import pyperclip
$>>> pyperclip.copy('teststring')
BUT if I do the exact same thing in an script
import pyperclip
pyperclip.copy('teststring')
and execute this script with python filename.
It won’t get stored in the clipboard.
Any ideas on where the error may happen?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:9
- Comments:22 (1 by maintainers)
Top Results From Across the Web
Pyperclip does not persist if script exits - python
It works for me with pyperclip-1.5.27. With this script, test.py: import pyperclip pyperclip.copy('The text to be copied to the clipboard.
Read more >Pyperclip does not persist if script exits : r/learnpython
I want to store something into the clipboard via a python script. It's basically just pyperclip.copy('text').
Read more >ModuleNotFoundError: No module named 'pyperclip'
I have made it to chapter 6 which deals with manipulating strings in python and working on the project of creating a multi-clipboard...
Read more >Pyperclip module in Python
Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with both Python 2 and 3. This module was...
Read more >Welcome to Pyperclip's documentation! — Pyperclip 1.5 ...
In order to work equally well on Windows, Mac, and Linux, Pyperclip uses various mechanisms to do this. Currently, this error should only...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

guys, u need xclip n xsel:
sudo apt-get install xclip xsel
For Arch based,
sudo yay -S xclip xsel