Search code examples
pythonarrayspyperclip

Using Pyperclip to copy and paste a 2d array


I am using pyperclip in Python 3.6

If i have a giant 2D array(640X480) how can I copy it in one program and paste it another program using pyperclip copy() and paste() functions.


Solution

  • In the 1st program use the following code:

    pyperclip.copy(array)
    

    In the 2nd program use this:

    array=eval(pyperclip.paste())