为什么我对以下这行Python代码收到语法错误提示?
python -c 'import re; if True: print "HELLO";'
File "<string>", line 1
import re; if True: print "HELLO";
^
SyntaxError: invalid syntax
以下代码运行良好:python -c 'if True: print "HELLO";'
我该如何将我的一行命令更改为在单行命令行上执行所需脚本的命令?
cat scripts/myscript.py | ssh localhost python
- guettli