Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editing a pyinstaller .exe file

So, i have managed to create an executable file in windows, out of a python script using pyinstaller. I tried pyinstaller myscript.py and the buid and dist folders were created, along with the .spec file

However, at a later time, i am making changes to the underlying code. So what i need to do is recompile and my application works again.

But, is there a way in which i can edit the already existing application? Or do i have to always recompile, after making a change ?

Also, what is the purpose of the .spec file?

like image 336
M PAUL Avatar asked Dec 13 '16 05:12

M PAUL


People also ask

Can you edit a EXE file?

EXE and DLL files are not plain, traditional text files that you can easily read and edit. You cannot simply open up an . EXE like a document file and start editing or reading the contents.

Can PyInstaller be decompiled?

PyInstaller Extractor is a Python script to extract the contents of a PyInstaller generated executable file. The header of the pyc files are automatically fixed so that a Python bytecode decompiler will recognize it. The script can run on both Python 2. x and 3.


1 Answers

Spec-file is needed to keep some options for pyinstaller to build your project such as hidden imports, attached data files, the name of output exe-file, etc. It is always created by using pyinstaller first time. Next time if you want to build your changed project use this command specifying the spec-file:

$ pyinstaller myscript.spec

For more information about spec-files read documentation: https://pyinstaller.readthedocs.io/en/stable/spec-files.html

like image 71
Fomalhaut Avatar answered Oct 14 '22 16:10

Fomalhaut