cmd中命令太长,可以更改吗?


比如我设置了python的环境变量,运行时输入:

>python hello.py

即可,但我还是觉得输入python太长,能不能设置成py类似的?

Linux python shell

昔日的小伙伴 11 years, 4 months ago

修改hello.py的权限,加上执行权限

chmod +x hello.py

在hello.py第一行加上相应的python路径

#!/usr/bin/python

然后直接运行

./hello.py

就能用python解析执行hello.py这个文件了。

刚吃了片安定 answered 11 years, 4 months ago

Your Answer