开发者

Python code as arguments

开发者 https://www.devze.com 2023-03-06 12:11 出处:网络
How to pass a piece of code as arguments to python? I tried like this, but it didn\'t work. $ python3 \'print(\"hello world\")\'

How to pass a piece of code as arguments to python?

I tried like this, but it didn't work.

$ python3 'print("hello world")'

can't open file 'p开发者_如何学Pythonrint(hello': [Errno 2] No such file or directory


python -c 'print("hello world")'


Try

python3 -c 'print("hello world")'
0

精彩评论

暂无评论...
验证码 换一张
取 消