开发者

Imports with Pydev/Eclipse

I'm working with the interactive console in eclipse, and reload does not show updated functions in my code. My code was :

def func1():  
    return 1  
def func2():  
    return 2  

but when I changed it to

def afunc1():  
    return 1  
def 开发者_JAVA百科func2():  
    return 2  
def func1():  
    return 3 

and ran imp.reload(TestMod), I got a 'module' object has no attribute 'afunc1()'.

Also, sometimes the functions are loaded and sometimes they are not.


Turns out, eclipse was not saving the file (or not saving it to the correct location) when I hit ctl-s. To get it to work, I had to right click the file name in the Package Explorer and select open with PyDev and save it under that

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜