There isn't any need to add file.py
while importing. Just write from file import function
, and then call the function using function(a, b)
. The reason why this may not work, is because file
is one of Python's core modules, so I suggest you change the name of your file.
Note that if you're trying to import functions from a.py
to a file called b.py
, you will need to make sure that a.py
and b.py
are in the same directory.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…