Answer the question
In order to leave comments, you need to log in
How to make your own Python installer with a single .exe file?
I have a Python script that I compile with pyinstaller into a single .exe file. Further, the one who receives this exe file should open it and some files should be automatically installed. I use shutil.move("HelloWorld.txt", "C:\\Users\\" + getpass.getuser + "\\Desktop" ), but for this line of code to work correctly, the HelloWorld.txt file must be in that the same folder as the compiled exe. That is, for work and normal installation, there should already be at least two output files, an .exe script compiled using pyinstaller and a file that will need to be installed. But I need to somehow push HelloWorld.txt into the exe itself, so that the output is one .exe with the HelloWorld.txt file inside.
I tried to use the .spec file in pyinstaller and entered ('.\\HelloWorld.txt') in the datas line, compiled, the file really ended up inside the exe (the resulting exe increased in size), but when it starts it swears that there is no such file, as I understand it, he is looking for this file in the same folder in which he is located, but he needs to look for this file in himself. How to do it?
Answer the question
In order to leave comments, you need to log in
https://qna.habr.com/q/707515
https://coderoad.ru/41870727/Pyinstaller-%D0%B4%D0...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question