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

后端 未结 7 647
-上瘾入骨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:58

    Another way to do it could be by creating an alias. For example in terminal write:

    alias printhello='python /home/hello_world.py'
    

    Writing printhello will run hello_world.py, but this is only temporary. To make aliases permanent, you have to add them to bashrc, you can edit it by writing this in the terminal:

    gedit ~/.bashrc
    

提交回复
热议问题