I have a python script that reads a local file (let's call it file.foo
). When I compile the script, I need that local file inside the executable so i use pyinstaller like this:
> pyinstaller --onefile --add-data "file.foo" "script.py"
The thing is, when I run the executable, my script cannot find file.foo
which is embedded with it.
Is there a way to read files compiled within the executable?
PS: I would prefer using --onefile
to keep it closed source