简体   繁体   中英

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. 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. Not really sure what I'm missing, both machines running similar software except windows 7 is in 64-bit windows.

I'm not getting any errors and the py2exe ran without any problems. 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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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