I have written a python code which displays a window using Tkinter. It also calls another python file present in the same folder. I converted the .py files into a .exe file using py2exe. But i am facing the below issues:
The output (in dist folder) is a set of files and not a single executable file.
'bundle_files':1,'compressed':True
, i should be getting a single file.The icon is not changed.
"icon_resources":[(0,"icon.ico")]
in the "windows" sectionBelow is the setup.py i used:
from distutils.core import setup
import py2exe, glob,sys,os
sys.argv.append('py2exe')
setup(
options={'py2exe':{'bundle_files':1,'compressed':True}},
windows=[{"script":'hr_data_downloader.py',"icon_resources": [(0,"icon.ico")]}],
data_files = [],
zipfile=None
)
I had issues running the executable at first but after going through the below posts, i corrected it by explicitly adding the two dlls.
Creating single EXE using py2exe for a Tkinter program
py2exe - generate single executable file
Please let me know if it is possible to create a single-file executable by modifying the setup files or any other py2exe files. Also please tell me why the icon is not shown for the created .exe
I am open to try other distribution utilities like py2exe if it can help me create single-file executable.
I figured out how to do it using pyinistaller. Although it makes the exe considerably large, i am happy that i have only single file.
Below is what i did:
pyinstaller --onefile --windowed myframe.py
The manual for pyinstaller has detailed explanations.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments