0

I have my main program and he needs 2 python scripts and a xml file to run. When i use pyinstaller i make an executable file but he don't work because he needs that 2 python scripts and xml file. When i add them to the path of executable,the executable works,but if not..it doesn't work. How to make a single file ? main_program.py and add the 2 scripts and xml file to it to make "A single executable" ? I mentioned that in my main program,i used subprocess.call and sent some arguments to these 2 scripts and i really need some help. Thank you!

Faza C
  • 13
  • 2
  • Have a look at [Documentation](http://pythonhosted.org/PyInstaller/usage.html#what-to-bundle-where-to-search) about `-p` option. That's how you can add additional `.py` files. However, adding `xml` file might be problem. But do you really need it as an independent file? Maybe you are able to generate it in your script or include it as commented code in one of your `.py` files? – Matho May 03 '17 at 12:38
  • Possible duplicate of [Bundling data files with PyInstaller (--onefile)](http://stackoverflow.com/questions/7674790/bundling-data-files-with-pyinstaller-onefile) – Repiklis May 04 '17 at 09:19
  • Try the [--hiddent-import](https://pyinstaller.readthedocs.io/en/stable/usage.html#what-to-bundle-where-to-search) and [--add-data]([a](https://pyinstaller.readthedocs.io/en/stable/usage.html#what-to-bundle-where-to-search)) options. There are also several examples in SO to help you with these. – Repiklis May 04 '17 at 09:28

0 Answers0