py2exe - 在将我的python脚本转换为.EXE文件后,无法再将其他Windows应用程序中的文本复制/粘贴到我的Python应用程序 [英] py2exe - Can no longer Copy/Paste text from other Windows app to my Python app after converting my python script to a .EXE file

查看:830
本文介绍了py2exe - 在将我的python脚本转换为.EXE文件后,无法再将其他Windows应用程序中的文本复制/粘贴到我的Python应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近尝试使用py2exe将我的一个python脚本(用于文件系统I / O)转换为可执行文件。但是,从我的python脚本成功生成.exe文件后,我不能再复制和粘贴任何文本(或任何事情)从其他Windows应用程序到我的python应用程序控制台(当我运行脚本/应用程序.exe文件)。当鼠标现在右键单击时,访问窗口不会再弹出。有谁知道我如何解决这个问题?

I recently tried to convert one of my python scripts (used for file-systems I/O) to a executable file by using py2exe. However, after successfully generating the .exe file from my python script, I am no longer able to copy and paste any text(or anything for that matter) from other windows apps to my python app console (when I run the script/app from the .exe file). When right click the mouse now, the access window does not pop up any longer. Does anyone know how I can get around this issue?

感谢,

AL

推荐答案

右键单击控制台窗口是Windows Vista及更高版本的命令行解释器的特殊功能。它不适用于任何其他命令行工具,因此它不再适用于您转换的脚本。您仍然可以使用Windows菜单(标题栏或Alt +空格中的小图标)访问它。

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

您可以尝试通过混乱获得右键单击功能周围有Windows API调用 - 但更方便的可能性是使用Ctrl + V启用粘贴,并忘记窗口菜单。一个好的候选人是 PyReadline - 安装软件包并在您的脚本的开头:

You could try to get the right-click feature back by messing around with Windows API calls - but the more convenient possibility would be to enable pasting using Ctrl+V and forget about the window menu. A good candidate is PyReadline - install the package and run this at the beginning of your script:

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

这篇关于py2exe - 在将我的python脚本转换为.EXE文件后,无法再将其他Windows应用程序中的文本复制/粘贴到我的Python应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆