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

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

    I do the following:

    1. put #! /usr/bin/env python3 at top of script
    2. chmod u+x file.py
    3. Change .py to .command in file name

    This essentially turns the file into a bash executable. When you double-click it, it should run. This works in Unix-based systems.

提交回复
热议问题