python_pardus
python_pardus

Reputation: 320

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

Upvotes: 1

Views: 15952

Answers (2)

python_pardus
python_pardus

Reputation: 320

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.

Upvotes: 1

Charitoo
Charitoo

Reputation: 1872

Use this command.

pyinstaller --onefile --windowed script.py

That should solve the problem.

Upvotes: 1

Related Questions