Getting folder path to script errors after compiling with pyinstaller

Advertisements I am working on a small gui using Tkinter when I set the path to the icon in the script it works fine but when I run it as a exe file it says it cant be found and the path it displays is AppData\Local\Temp. What am I doing wrong? root.iconbitmap(os.path.dirname(os.path.realpath(__file__))+"\\Icon.ico") for pyinstaller I… Read More Getting folder path to script errors after compiling with pyinstaller

PyInstaller –add-data from script

Advertisements I’m trying to create an executable file out of my python project. I’m using the function ‘make_executable’ to build an executable file. Running the command to add data raises an error like: pyinstaller: error: unrecognized arguments: –add-data C:\Users<>… –add-data: C:\Users<>… def make_executable(main_script: str, files_to_add: List[str], target_location: str = None, name: str = ‘app’, single_file:… Read More PyInstaller –add-data from script

Stop Python exe script from converting back

Advertisements For example, I have a Python file like this: print("Hello World") Now I am converting it to an .exe file using pyinstaller. But I found a method to convert it back: Use pyinstxtractor.py: python pyinstxtractor.py yourFileName.exe This will extract .exe and create a folder named yourFileName.exe_extracted. Inside the yourFileName.exe_extracted folder, find the file without… Read More Stop Python exe script from converting back