python: 无法在 macbook 终端中打开文件 - [Errno 2]!

python: can't open file in macbook terminal - [Errno 2]!

在我的 macbook air terminal 我写了

python eggshell.py

但是我遇到了这个错误

python: can't open file 'eggshell.py': [Errno 2] No such file or directory s-user:/ user$

出现该错误后,我尝试了很多方法,例如确切指定 eggshell.py 是:

python Users/myuser/Eggshell/eggshell.py

这样做只是给了我一个不同的 Errno 2 错误:

OSError: [Errno 2] No such file or directory: 'modules/commands/macOS'

如果您有任何可以帮助我解决这个问题的方法,我将不胜感激,谢谢。 P.S 我将附上 eggshell.py 所在位置的图片

eggshell.py其实是在我的文档里的一个文件夹里,但是它也出现在文档里,所以我真的不知道为什么python eggshell.py不起作用。

您必须在 eggshell.py 所在的目录中。 (使用 cd 导航)