“Copy to the clipboard” is one of those things that sound easy until you actually try to do it, like “let’s fly to the moon” or “why can’t everyone just get along?”.
Especially on Linux. From the project notes for pyperclip:
“On Linux, this module makes use of the xclip or xsel commands, which should come with the os. Otherwise run “sudo apt-get install xclip” or “sudo apt-get install xsel” (Note: xsel does not always seem to work.) Otherwise on Linux, you will need the gtk or PyQt4 modules installed.”
So to get copy and pasting to work on Linux, you have to be prepared to try four different techniques (with at least one of them allegedly unreliable).
If you are sure that this app of yours is only for personal use and won’t be used by people on other flavours of Linux, or MacOS, or Windows, or other non-Linux unixes and POSIX systems, then you could copy the relevant code from pyperclip into your own project and use that instead.
And then be prepared to deal with bugs in copy/pasting yourself.
But if you expect to distribute this app to others, you will be better off using the external dependency (assuming the licence is suitable).
Alternatively, you could try a different copy/paste library. There is, allegedly, at least two others:
Finally, your GUI framework may already support copy and paste out of the box. What GUI framework are you using? If it is Tkinter, this may work for you:
(Disclaimer: I have no idea if it copies and pastes into the system clipboard so that other applications can use that data, or just an internal clipboard.)