我刚刚开始学习Python,我很难在终端上进行测试。
我只想在Python解释器中运行一个预先编写的Python方法。(我知道如何通过python文件运行它_名称.py,但我想在解释器中运行它)。在
所以如果我有档案“示例模块.py“:
def exampleFunc(data):
print(data)
然后在终端中运行Python并执行以下操作:
^{pr2}$
我不明白的是,如果我在pythonidle中运行模块,我可以访问exampleFunc,但不能在终端解释器中访问。在
谢谢!在
Tags:
当你这么做的时候
你必须写下它函数的全名。根据Docs*
如果只想写函数名,那么就写
^{pr2}$根据Docs*
**为了更好地理解,将函数名称改为您的名称。*
相关问题 更多 >
编程相关推荐