I have a simple python program and I want an executable version (for Ubuntu Linux) of this program to avoid running it in the terminal with python myprogram.py
.
How can I do that ?
In this section, we can also modify the path for where we want to export the files generated by our executable file: to do this, select the “Settings” toggle option and browse to the output directory of your choosing. The last step is to select “Convert . py to .exe” to convert our Python file.
Run the following command in your terminal to make the script executable: chmod +x SCRIPTNAME.py. Now, simply type ./SCRIPTNAME.py to run the executable script.
There is no need to. You can mark the file as executable using
chmod +x filename
Make sure it has a shebang line in the first line:
#!/usr/bin/env python
And your linux should be able to understand that this file must be interpreted with python. It can then be 'executed' as
./myprogram.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With