def函数安装调用的疑惑

如果在新建File中定义了def,F5在shell中运行成功,那么在同一个shell中可以调用这新定义的函数。

但是如果关闭了shell新打开一个shell,那么调用不成功。

>>> import nester3
>>> sarah = nester3.get_coach_data('sarah.txt')
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    sarah = nester3.get_coach_data('sarah.txt')
AttributeError: module 'nester3' has no attribute 'get_coach_data'
>>> 

即使安装这个函数也调用不成功。不知道为什么。

posted @ 2017-08-26 15:49  dang幸福来敲门  阅读(169)  评论(0编辑  收藏  举报