我将如何将函数从外部 python 文件添加到当前 python 文件?

How would I go about adding functions from external python file to current python file?

我主要想用导入命令导入函数到current_file.py。我尝试这样做:

from functions.py import *

但它抛出一个错误:

current_file.py and functions.py files are in the same directory.

删除“.py”扩展名

喜欢:

from functions import *

如果你想在你自己的函数路径中组织你的文件,你可以像这样导入:

from [your function path].[your function files] import *