The first thing to do is to look at how you're calling the function. Assuming it's in myModule.py
, did you import myModule
or did you from myModule import calrounds
? If you used the first one, you need to call it as myModule.calrounds()
.
Next thing I would do is to make sure that you're restarting your interpreter. If you have import
ed a module, importing
it again will not reload the source, but use what is already in memory.
The next posibility is that you're importing a file other than the one you think you are. You might be in a different directory or loading something from the standard library. After you import myModule
you should print myModule.__file__
and see if it is the file you think you're working on. After 20 years of programming, I still find myself doing this about once a year and it's incredibly frustrating.
Finally, there's the chance that Python is just acting up. Next to your myModule.py
there will be a myModule.pyc
- this is where Python puts the compiled code so it can load modules faster. Normally it's smart enough to tell if your source has been modified but, occassionally, it fails. Delete your .pyc
file and restart the interpreter.