1

When I am trying to converting my python file into executable and binding with pdf with using command add-data. My pdf file is store no where due to this I cannot open my pdf file while opening executable.(yes, but command will create executable properly but there storing of pdf in default temp directory).

command:

pyinstaller.exe --add-data src;. --onefile python_file.py

P.s:- I tried to popen my file through my code but pdf is storing nowhere so, I cannot execute popen command

4

1 回答 1

0

The documentation of pyinstaller is here: https://pyinstaller.readthedocs.io/en/stable/usage.html and syntax of this command is:

--add-data <SRC;DEST or SRC:DEST>
    Additional non-binary files or folders to be added to the executable. The path 
separator is platform specific, os.pathsep (which is ; on Windows and : on most unix 
systems) is used. This option can be used multiple times.

It means that for each folder of data you need use this parameter once. SRC is path in your system. DST is path relative to your bundle root. I suggest do not use --onefile when you have some problem with build. Then you can easier inspect resulted build.

于 2019-08-18T07:20:48.377 回答