pip install pyinstaller
pyinstaller <file name>.py
pyinstaller --onefile <file name>.py
pip install pyinstaller
pyinstaller <file name>.py
pyinstaller --onefile <file name>.py
pyinstaller --onefile --noconsole <file name>.py
pyinstaller --onefile --windowed --icon=<project-logo>.ico --add-data "<folder>;<folder>" <filename.py>
# Enter this command in the command prompt
pip install pyinstaller
pip install pyinstaller
pyinstaller --onefile --noconsole "<filename>"
# the exe is in the dist folder
pyinstaller file.py # Basic programs
pyinstaller --noconsole file.py # GUI programs
pyinstaller --noconsole --onefile file.py # GUI programs with just one file
pyinstaller --onefile --noconsole <"filename">
pyinstaller -- onefile <file name>
"""
You use: pip install pyinstaller
to install Pyinstaller
Then use pyinstaller --onefile YourFileName.py to convert EXE
"""
import PyInstaller.__main__
PyInstaller.__main__.run([
'my_script.py',
'--onefile',
'--windowed'
])
# is equivalent to
# pyinstaller my_script.py --onefile --windowed
#Run pyinstaller and stop it to generate the spec file :
> pyinstaller filename.py
#A file with .spec as extension should be generated
#Now add the following lines to the beginning of the spec file :
> import sys
> sys.setrecursionlimit(5000)
#Now run the spec file using :
> pyinstaller filename.spec