
1 jmc891205 2018-04-02 16:19:54 +08:00 |
2 willxiang 2018-04-02 16:22:35 +08:00 |
3 lukeshawn OP @jmc891205 你好,我在命令行模式下输入了你的 2 种方法,方法一没变,方法二显示:-bash: u+x: command not found ; 然后我试着在 python 交互模式下输入这个,显示 SyntaxError: invalid syntax |
4 araraloren 2018-04-02 16:46:48 +08:00 Maybe your python script missing the executable permission. |
5 lukeshawn OP @araraloren how to figure it out |
6 yxy2829 2018-04-02 17:10:55 +08:00 加 sudo |
7 mssora 2018-04-02 17:35:24 +08:00 @lukeshawn #1 的命令都是在 shell 里面运行的,还有如果要直接运行需要在脚本第一行指定解释器:#!/usr/bin/env python |
9 yianing 2018-04-02 18:34:50 +08:00 新人先用 IDE 吧,一键运行,还有提示。 |