Search code examples
pythonlinuxfile-permissions

What do I use on linux to make a python program executable


I just installed a linux system (Kubuntu) and was wondering if there is a program to make python programs executable for linux.


Solution

  • 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