views:

84

answers:

1

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 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.

A: 

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

amccormack
Also a quick tip, sometimes I do a Project->Clean on my projects if it seems like weird errors are showing up.
Roman Stolper