我正在尝试使用Mac的终端调试和测试我的python程序,但我总是收到错误消息。
有人可以帮忙吗,我需要在Mac上写一些不同的东西吗?以下是我写的内容和错误。我已经尝试了几种不同的方式,例如从和其他文件导入,但始终出现相同的错误消息。
Type "help", "copyright", "credits" or "license" for more information.
>>> python -i notebook.py
File "<stdin>", line 1
python -i notebook.py
^
SyntaxError: invalid syntax
>>>
您需要跑步
$ python3 -i notebook.py
在终端中。 不要首先使用$ python3
命令打开Python解释器。