简体   繁体   English

在Windows 8中编写了一个python脚本,并使用py2exe获得了一个exe,当移至Windows 7时,它将打开cmd,然后关闭

[英]Wrote a python script in windows 8 and used py2exe to get a single exe, when moved to windows 7 it opens cmd then closes

Windows 8 running in 32-bit using vs-code to write a simple python script to configure an ip address quickly through command line. Windows 8以32位运行,使用vs代码编写简单的python脚本以通过命令行快速配置ip地址。 Was able to successfully (after many attempts) to create a single exe with it and launch it in windows 8. Tried moving it to my other laptop running windows 7 and it would only show the command line and then close out. 能够成功(经过多次尝试)使用它创建一个单独的exe并在Windows 8中启动它。尝试将其移动到运行Windows 7的其他笔记本电脑中,它只会显示命令行,然后关闭。 Not really sure what I'm missing, both machines running similar software except windows 7 is in 64-bit windows. 不太确定我缺少什么,除了Windows 7之外,两台运行类似软件的机器都位于64位Windows中。

I'm not getting any errors and the py2exe ran without any problems. 我没有收到任何错误,并且py2exe运行没有任何问题。 I can compile it again on my windows 7 box and try it there but would like to be able to write on one machine for both. 我可以在Windows 7盒中再次编译它,然后在那儿尝试,但希望能够在一台机器上为两者编写。

Any help is always appreciated. 任何帮助总是很感激。

I stumbled upon this the other day. 前几天我偶然发现了这个。

The executable created most of the time is forward compatible: If you create the executable in Windows XP, it will run in Vista and 7. However it is not backwards-compatible: if you create the executable in Windows 7 it is not going to run on Windows XP. 大多数情况下创建的可执行文件是向前兼容的:如果在Windows XP中创建该可执行文件,则它将在Vista和7中运行。但是,它不是向后兼容的:如果在Windows 7中创建该可执行文件,则将不会运行。在Windows XP上。

From: http://www.pythoncentral.io/py2exe-python-to-exe-introduction/ 来自: http : //www.pythoncentral.io/py2exe-python-to-exe-introduction/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM