I have a python program that takes in as input two text files. I have converted this python program(a .py file) to a .exe file using pyinstaller. The .exe file when run gives FileNotFoundError. But when the .txt file is copied to the path where .exe is present it works fine. My intention is to not copy the .txt file but bundle the .txt file along with .exe so that the .txt file is inaccessible. All .txt file dependencies i want to bundle it with .exe, ultimately there should be just one .exe file, when i run it, it should work the same way as when i run the python program. Please suggest me ways in achieving the same
I am new to pyinstaller. I had tried adding the .txt files to data parameter in the .spec file. But this fails to copy the text files into the dist folder where my .exe is present. But as i have mentioned i just need the .exe file alone. Even if the .exe file is shared to someone else who do not have access to any of the text files, the .exe must run sccessfully
a.datas+=[('D:/Trial/src/readme_text_files/readme1.txt','readme_text_files/readme1.txt','readme_text_files'), ('D:/Trial/src/readme_text_files/readme2.txt','readme_text_files/readme2.txt','readme_text_files'), ]
The above code has been added to .spec file, as a result i assume that the readme_text_files must be copied to the folder where .exe is present when you run: pyinstaller spec_filename.spec