如何在命令行shell中运行内联Python代码?

2024-05-29 02:17:18 发布

您现在位置:Python中文网/ 问答频道 /正文

在shell中,我可以执行如下AppleScript命令行代码:

osascript -e "tell application \"Finder\" to activate"

在Python中是否也可以这样做,例如:

python --execute "print('hello world!')"

Tags: to代码命令行helloworldexecutefinderapplication

热门问题