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

后端 未结 7 649
-上瘾入骨i
-上瘾入骨i 2020-11-27 15:55

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

7条回答
  •  北海茫月
    2020-11-27 16:13

    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
    

提交回复
热议问题