Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy string - Python

Ok guys I imagine this is easy but I can't seem to find how to copy a string. Simply COPY to the system like CTRL+C on a text.

Basically I want to copy a string so I can for example, lets say, paste(ctrl+v).

Sorry for such a trivial question, haha.

like image 368
dpswt Avatar asked Mar 15 '26 08:03

dpswt


1 Answers

For Windows, you use win32clipboard. You will need pywin32.

For GTK (at least on GNU/Linux), you can use pygtk.

EDIT: Since you mentioned (a bit late) you're using wxPython, they actually have a module for this too, wx.Clipboard.

like image 91
Matthew Flaschen Avatar answered Mar 16 '26 21:03

Matthew Flaschen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!