After your first run of pyinstaller, a .spec
file is created, which you can modify. Then on your next call to pyinstaller, instead of pointing to your .py
script, point to the .spec
file instead.
Then you are able to make modifications to the spec file, where you can add the following line afer the Analysis
call to compile any data files into your .exe
. Insert the appropriate path and name of your icon
a.datas += [('name_of_icon.ico', 'path_to_icon\name_of_icon.ico', 'Data')]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…