Link to home
Start Free TrialLog in
Avatar of NetRock6
NetRock6Flag for Canada

asked on

Python executable script

Hi,
Trying to convert a python script into executable one file using pyinstaller in Linux. In my python script using subprocess I call few bash files, what is the best way to add them to the
executable as well. I use the comamnd: "pyinstaller --one-file pythonscript" to build the executable.

Thank you for your quick prompts.
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NetRock6

ASKER

In pyinstaller there are other options like --add-binary or --add-file. How these options work then.
My bash script is with .sh extension.
Thanks
How complex are these bash scripts?

If they're not too complex, you can use system calls in python to run the commands from the scripts, like this:

import os
os.system("tail -10 somefile > somesmallerfile")

Open in new window

Then you could use pyinstaller to build your executable.