Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 完全相同的shebang不工作_Python_Tcsh_Shebang - Fatal编程技术网

Python 完全相同的shebang不工作

Python 完全相同的shebang不工作,python,tcsh,shebang,Python,Tcsh,Shebang,因此,我正在尝试创建一些我想要运行的脚本,而无需在每次运行解释器时手动指定解释器 #!/usr/bin/python 上面是一个现有脚本上的shebang,它按照我希望的方式运行 下面是我白手起家写的一个剧本 #!/usr/bin/python 对我来说,它们看起来一模一样,但运行第二个会给我一个 helloWorld.py: permission denied 两者都是使用kate、utf-8和unix行创建的。 两者都和我一样 有什么想法吗?shebang可能是正确的,但是脚本还需要执

因此,我正在尝试创建一些我想要运行的脚本,而无需在每次运行解释器时手动指定解释器

#!/usr/bin/python
上面是一个现有脚本上的shebang,它按照我希望的方式运行

下面是我白手起家写的一个剧本

#!/usr/bin/python
对我来说,它们看起来一模一样,但运行第二个会给我一个

helloWorld.py: permission denied
两者都是使用kate、utf-8和unix行创建的。 两者都和我一样


有什么想法吗?

shebang可能是正确的,但是脚本还需要执行权限

# Anyone can execute
chmod +x helloworld.py

# Only the file owner can execute
chmod u+x helloworld.py

shebang可能是正确的,但脚本还需要执行权限

# Anyone can execute
chmod +x helloworld.py

# Only the file owner can execute
chmod u+x helloworld.py

您需要设置脚本的权限。尝试:

chmod u+x helloWorld.py

然后再次运行。

您需要设置脚本的权限。尝试:

chmod u+x helloWorld.py

然后再次运行。

问题不是/usr/bin/python的权限,而是实际脚本的权限

如果从命令行运行,并且没有将脚本名称作为参数传递给python,那么脚本必须是可执行的


如果没有,则使用chmod
chmod+x helloworld.py进行修复

问题不是/usr/bin/python的权限,而是实际脚本的权限

如果从命令行运行,并且没有将脚本名称作为参数传递给python,那么脚本必须是可执行的


如果没有,则使用chmod
chmod+x helloworld.py进行修复

错误消息是抱怨权限,而不是shebang行。这两个文件的权限是什么?错误消息是抱怨权限,而不是shebang行。这两个文件的权限是什么?谢谢!就是这样…使用chmod进行其他权限设置…在设置可执行性时以某种方式隔开谢谢!就是这样…使用chmod进行其他权限设置…在设置可执行文件时以某种方式隔开