Questions tagged [pyperclip]

A cross-platform clipboard module for Python.

Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with Python 2 and 3.

More information:

191 questions
2
votes
2 answers

how can I copy a string to the windows clipboard? python 3

If I have a variable var = 'this is a variable' how can I copy this string to the windows clipboard so I can simply Ctrl+v and it's transferred elsewhere? I don't want to use anything that isn't that isn't built in, I hope it's possible. thanks!
Toby Smith
  • 1,505
  • 2
  • 15
  • 24
1
vote
1 answer

Python code to copy text from a virtual machine to clipboard

I have a text file on a virtual machine (without a GUI) to which I am connected through ssh in VSCode. I want to write python code that reads some text from this file and copies this to the clipboard so that I can paste this text into the browser…
1
vote
1 answer

Encoding error when printing data from clipboard, but works when the data is hardcoded

I'm trying to copy all text data from an Amazon search result page (say the search term is laptop), using Ctrl+A, Ctrl+C through PyAutoGui. Then get the data using either pyperclip.paste() or pd.read_clipboard() and print it. Here's the code: import…
Fahim
  • 308
  • 1
  • 3
  • 10
1
vote
0 answers

How to get Pyperclip to paste new lines in virtual machine?

I'm trying to use pyperclip to open text files, copy the text and then paste that in software I use on a EC2 windows machine using Remote Desktop on Windows. When I copy the text file it pastes it in the format I need on my host machine just fine…
1
vote
1 answer

Python - How to search in google without typing url

I tried to take the input from the user, copy it, and then open google and paste the input. this is my code: import webbrowser import pyperclip question = input("search for: ") pyperclip.copy(question) url = 'http://www.google.com/' chrome_path…
Basel
  • 17
  • 1
  • 3
1
vote
0 answers

Python how to wait for detect Ctrl+V and then continue

I am writing a python script that prepares a number of pieces of data to be posted into a web page and copies them to the clipboard using pyperclip. Currently I just have a time.sleep() statement between each one but based on latency and some…
Aaron Reese
  • 544
  • 6
  • 18
1
vote
0 answers

No module named 'PySide' when using Mu

I've read all the other questions referencing this issue and tried the solutions but can't seem to get pyperclip working in Mu. When I try running: >import pyperclip >pyperclip.copy('Hello, world') >pyperclip.paste() I get the following…
Andy Choy
  • 11
  • 1
1
vote
0 answers

Iterating through a list using a key listener (pynput) without copying words manually

Description of what I want to achieve: I have a file which consists of words. Let's say they are "fish","tacos","burger". Every time I paste a word (cmd + v on Mac or ctrl + v on Windows), I want the clipboard to move to the next word, so that I…
1
vote
0 answers

How To - Copy each item in a list to another database (RPA - Python)

What I want to do: Turn a csv file into a list and copy each of those item and paste somewhere else. Why: Wanna a RPA script to do that for me. My problem: My csv file might have different count of rows. When I use pyperclip to copy an item, I can…
1
vote
0 answers

Copy clipboard in Python only if text

I'm doing a tool to store clipboard texts in a list and is there a way in Python to check the data in the clipboard if it is a text or file across multiple platforms. Currently, I'm using pyperclip.copy() which gives me the clipboard data but if a…
Prabu_7
  • 21
  • 2
1
vote
0 answers

Trouble installing python packages to target folder (ERROR: Can not combine '--user' and '--target')

I am going through "Automate the Boring Stuff" and I am using Mu as a text editor. I am trying to install a particular package called pyperclip. Since Mu has its own Python environment, I am trying to install pyperclip into its /pkgs folder. I…
1
vote
1 answer

Copy text from environment variable and paste in Selenium (Python)

I'm trying to paste a massive amount of text to an input element with Selenium using Python 3.8 on an Ubuntu OS. I can iterate over my string and send_keys, but that takes more than 60 seconds. I was hoping I could copy my text from my Python code…
Yaakov Bressler
  • 9,056
  • 2
  • 45
  • 69
1
vote
0 answers

'You don't have permission to save in this location. Contact the administrator to obtain permission' I am sole Admin on computer

I am trying to use a pip feature in python called pyperclip, I am working through automate the boring stuff by Al Siegwart. I am supposed to open a file editor and save the file as mclip.bat in the C:\Windows folder: First it has you build it in MU…
Alex
  • 11
  • 4
1
vote
4 answers

Pyperclip error on WSL2 running Ubuntu 18 LTS while trying to access data copied from windows

I am using IPython 7.16.1 (Python 3.7.7) on Ubuntu 18.04 running in WSL2 via Windows Terminal Preview (1.2.2234.0) on Windows 10 build 20190 (though the issue is not limited to IPython, it is with the shell itself). I am trying to use…
1
vote
1 answer

Python 3 Pyperclip Installed but Module not Found

I'm trying to copy some text to clipboad in my python program, so I've installed pyperclip via pip command via Windows command line interface, it says everything is successfully installed, not a problem. However, when I import the thing into my…
Ilya
  • 992
  • 7
  • 14
1 2
3
12 13