在ubuntu里直接通过终端编写运行python程序

时间:2026-02-13 11:45:44

1、进入ubutun打开终端输入:

mkdir hellowpython

新建hellowpython这个文件夹,可以在文件夹里找到它

在ubuntu里直接通过终端编写运行python程序

2、输入:

cd hellowpython

转入 hellowpython这个文件夹

在ubuntu里直接通过终端编写运行python程序

3、输入:

touch 01-hipython.py

建立一个python的源文件,这个文件可以在hellowpython这个文件夹里找到

在ubuntu里直接通过终端编写运行python程序

4、打开01-hipython这个文件

在里面输入python程序,注意保存

在ubuntu里直接通过终端编写运行python程序

在ubuntu里直接通过终端编写运行python程序

5、在终端里输入:

python 01-hipython.py

输入完python 01之后按tap键剩余可自动补全

enter后会在终端显示运行结果

在ubuntu里直接通过终端编写运行python程序

6、水平不高,能力有限,如有不足,感谢指正

© 2026 五度知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com