3
I have the following folders in my project
    1. fire.py
    2.main.py
    3.traffic.avi   #video file
    4. vechile.py
  1. I have already used py2exe GUI but in that you can't create a exe file for my scenario.Because i have a video and a few import files. My program main.py imports fire.py and vechile.py and the main program requires this video traffic.avi . Now how do I convert this entire thing into one executable file. I want the entire project to run when the .exe is created. Single file can be converted into exe file using pyinstaller but how do i convert this type of project containing video file and the main.py importing two python files fire.py and vechile.py and taking input video traffic.avi for processing.If possible provide the solution with steps for this scenario.
rakshit ks
  • 422
  • 5
  • 13

1 Answers1

1

pyinstaller --add-data 'traffic.avi:traffic.avi' --onefile main.py should work.

For accessing the file, have a look at Bundling data files with PyInstaller (--onefile)

EDIT: You don't have to add the other files manually, if you imported the classes or methods into your main.py as far as i know. Pyinstaller resolves those dependencies by itself. I corrected my command above. Looks like you have to specify the target-filename as well.

Floempi
  • 36
  • 3