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

后端 未结 7 672
-上瘾入骨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 15:59

    If one want to make executable hello.py

    first find the path where python is in your os with : which python

    it usually resides under "/usr/bin/python" folder.

    at the very first line of hello.py one should add : #!/usr/bin/python

    then through linux command chmod

    one should just make it executable like : chmod +x hello.py

    and execute with ./hello.py

提交回复
热议问题