Py2exe - can no longer copy / paste text from another Windows application into my Python application after converting my python script to .EXE file

I recently tried to convert one of my python scripts (used for file system I / O) to an executable using py2exe. However, after successfully creating the .exe file from my python script, I can no longer copy and paste any text (or something like that) from other Windows applications into the python application console (when I run script / app from the .exe file). When you right-click, the access window no longer appears. Does anyone know how I can get around this problem?

Thanks,

AL

+4
source share
1 answer

Right-clicking on the console window is a "special feature" of the Windows Vista command line interpreter and higher. It does not work in any other command line tool, so it no longer works for your converted script. You can access it using the window menu (small icon in the title bar or Alt + space).

You can try to return the right-click function using the Windows API calls, but a more convenient option would be to enable paste using Ctrl + V and forget about the window menu. A good candidate for PyReadline is to install the package and run it at the beginning of your script:

 import readline readline.parse_and_bind("control-v: paste") 
+6
source

All Articles