question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pyperclip does not persist if called from script

See original GitHub issue

I 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:open
  • Created 7 years ago
  • Reactions:9
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

25reactions
yangyangwithgnucommented, Aug 25, 2018

guys, u need xclip n xsel:

sudo apt-get install xclip xsel

0reactions
SmartManojcommented, Dec 17, 2022

For Arch based, sudo yay -S xclip xsel

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found