1

Hi I tried exporting my database into .sql then place it in same folder with my .py file hoping that when I make my .py into an executable file my the .sql will built into the .exe

But this didn't seem to work out because when I drop the database I used in my .py then run the executable file it wont run.

heres my folder where I do the pyinstaller

1 Answers1

1

You can add external data by using --add-data in commandline. The example from the docs:

pyinstaller --add-data 'src/README.txt:.' myscript.py

Or directly in the spec file :

added_files = [
     ( 'src/README.txt', '.' ),
     ( '/mygame/sfx/*.mp3', 'sfx' )
      ]
a = Analysis(...
     datas = added_files,
     ...
     )

If you want to do a one-file exe, also have a look at this question.

user_na
  • 2,154
  • 1
  • 16
  • 36