简体   繁体   中英

Program doesn't work as single and noconsole exe file (Pyinstaller)

I made a program with python and I want to turn it into an .exe file. I typed that command from the command prompt (cmd):

pyinstaller --onefile --noconsole script.py

I used Tkinter in my script. When I run the .exe file, a window didn't appear. How can I solve it?

@Charitoo I'm using Windows 7 32bit, Python 2.7.3

Use this command.

pyinstaller --onefile --windowed script.py

That should solve the problem.

I've solved my problem, because I could understand the reason for it. I was using this code in my Python script:

from subprocess import check_output
check_output("chcp 1254", shell=True)

I deleted these codes and my problem was solved.

These codes were the reason for the problem, because I was creating an exe file which doesn't have a console screen, but I was using a command which tries to access the command line. Therefore, my program was closing. Thanks to everybody.

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