我使用名为“test.py”的vim在Python3中创建了一个测试文件
def addtwo(one, two):
new = one + two
return new
我把那个文件保存在我的$HOME
目录中
然后我通过键入python3
打开Python shell
在shell I类型中:
from test.py import *
我得到的回报是:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'test.py'; 'test' is not a package
我想这是一个文件路径问题,我在谷歌上搜索了一下,但我可能没有正确地表达我的问题。有人能帮我照一下吗
而不是
它是
相关问题 更多 >
编程相关推荐