小编pet*_*ief的帖子

Python不会显示导入文件的代码更改

我使用的是linux python shell,每次我对导入的文件进行更改时,我都需要重新启动shell(我尝试重新导入文件,但没有反映出更改)

我在一个名为handlers.py的文件中有一个定义

def testme():
    print "Hello I am here"
Run Code Online (Sandbox Code Playgroud)

我在python shell中导入文件

>> import handlers as a
>> a.testme()

>>  "Hello I am here"
Run Code Online (Sandbox Code Playgroud)

然后我将print语句更改为"你好我在那里",重新导入处理程序,它没有显示更改?

使用带有Mint 17.1的Python 2.7

python import

4
推荐指数
1
解决办法
2774
查看次数

标签 统计

import ×1

python ×1