Just put this in the first line of your script :
#!/usr/bin/env python
Make the file executable with
chmod +x myfile.py
Execute with
./myfile.py
Answer from Vincent Van Den Berghe on Stack OverflowStandalone Python applications in Linux - Stack Overflow
I wrote a linux application in python and pyqt. How do I make and publish it on linux appstore
How to build python application to linux executable one file? - Stack Overflow
Build Python Applications - Stack Overflow
Create a deb (for everything Debian-derived) and an rpm (for Fedora/SuSE). Add the right dependencies to the packaging and you can be reasonably sure that it will work.
You can use cx_Freeze to do this. It's just like py2exe (bundles together the interpreter and and startup script and all required libraries and modules), but works on both Linux and Windows.
It collects the dependencies from the environment in which it is run, which means that they need to be suitable for the destination as well. If you're doing something like building on 32 bit Debian and deploying on another 32 bit Debian, then that's fine. You can handle 32/64 bit differences by building multiple versions in appropriate environments (e.g. 32 bit and 64 bit chroots) and distributing the appropriate one. If you're wanting something more generic (e.g. build on Debian, deploy on any distribution), then this gets a bit murky, depending on exactly what your dependencies are.
If you're doing a fairly straightforward distribution (i.e. you know that your build environment and deploy environments are similar), then this avoids the rather complex rpm/deb/egg/etc step (using cx_Freeze is very easy, especially if you're familiar with py2exe). If not, then anything from rolling your own dependancy installer to deb/rpm/egg/etc building will work, depending on how much work you want to do, how much flexibility with required versions you want to offer, and what the dependencies are.
I've written a .py file which seems to run without any errors so far. Now where do I go from here . How do I compile it into a application?and how do I publish it? Edit : I have one external dependencies rest all are included in python only.
Hi, how do I make a executable for Linux & Windows? I want it to be a single executable for Linux, just for organization. I tried to do appimage, but found out that is a tad too hard for me. Is there an easy way to make an executable for both of the OSs, from Linux?