Discuss / Python / linux执行.py文件

linux执行.py文件

Topic source

Dr_苏泊

#1 Created at ... [Delete] [Delete and Lock User]

!/usr/bin/env python3

print('hello, world')

然后,通过命令给hello.py以执行权限:

$ chmod a+x hello.py

./hello.py

少了个#吧?

不过,在mac命令行下,确实需要./xx.py来执行,谢谢指教,我刚才又直接去双击xx.py去了。。。。

求解,我在mac里执行显示: 。/hello.py:no such file or direction 谢谢!

AAAYuan___

#4 Created at ... [Delete] [Delete and Lock User]

同问!请问解决了吗?我也是这个问题./hello.py:no such file or direction 这么怎么解?


  • 1

Reply