DEV Community

Shubham Rajput
Shubham Rajput

Posted on

Tired of selecting and copy pasting the data from functions?

Often we require to print some value then select it and copy paste to different places to compare or debug, we can save some time using python's pyperclip which is very simple to use:

def copy_data_to_clipboard(string_data):
    import pyperclip
    pyperclip.copy(string_data)
    spam = pyperclip.paste

just have this function in your code and use it whenever you need.

Top comments (0)