我需要使用python -c远程运行一些代码,它在我使用时工作:
python -c "a=4;print a"
4
Run Code Online (Sandbox Code Playgroud)
要么
python -c "if True:print 'ye'"
Run Code Online (Sandbox Code Playgroud)
但python -c "a=4;if a<5:print 'ye'"会产生错误:
File "<string>", line 1
a=4;if a<5:print 'ye'
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能使它有效,有什么建议吗?
python ×1