Getting rid of console output when freezing Python programs using Pyinstaller
If you want to hide the console window, here is the documentation:
This is how you use the --noconsole
option
python pyinstaller.py --noconsole yourscript.py
If you need help using pyinstaller to get to the point where you need to use the --noconsole
option here is a simple tutorial for getting there.
Hide the console of an .exe file created with PyInstaller
Did you try --windowed
command line flag ?
Pyinstaller Codec Error on Executable When Using No Console And No Debug Option
I found out why it wasn't working, it's a bug in pyinstaller. It worked when I used the development version of pyinstaller. I ran pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
in cmd, and ran the pyinstaller command again, and it worked.
Is it possible to close cmd after opening exe file created from .py file?
You didn't specify the tools used to create the executable.
Assuming that you used PyInstaller:
When you execute the command pyinstaller [filename].py
, PyInstaller will actually create 2 folders and one .spec
file in your working directory:
- A
dist
folder, containing the bundled app. - A
build
folder, containing some log files and working files. - A
[scriptname].spec
file, containing the specifications given to PyInstaller during the creation of the executable file.
In your case (assuming that PyInstaller was used), to stop the terminal from opening on startup, you have to:
- Open the
.spec
file - Edit the entry
console=True
, setting it to false will prevent the terminal from opening. - Execute again the
pyinstaller
command in cmd, this time targeting the[scriptname].spec
file.
Related Topics
Is There a "Not Equal" Operator in Python
How to Make Python Requests Work via Socks Proxy
Python - Add Pythonpath During Command Line Module Run
How to Join Two Wav Files Using Python
Pil Thumbnail Is Rotating My Image
How to "Properly" Print a List
What Version of Visual Studio Is Python on My Computer Compiled With
Get _Name_ of Calling Function's Module in Python
Writing to MySQL Database with Pandas Using SQLalchemy, To_Sql
How to Print a List in Python "Nicely"
How to Select Elements of an Array Given Condition
Count Unique Values Using Pandas Groupby
Calculating Difference Between Two Rows in Python/Pandas
Executing Command Using Paramiko Exec_Command on Device Is Not Working
Which Is Faster in Python: X**.5 or Math.Sqrt(X)
Search for "Does-Not-Contain" on a Dataframe in Pandas
If Range() Is a Generator in Python 3.3, Why How to Not Call Next() on a Range