Here is my code to reload a python module using the reload() build in function. I have looked at some (not all :) ) the other questions and answers in stackoverflow but to get my code to work I still need to do a os.remove('m.pyc'). Can anybody maybe explain it to me or show me how I need to change my code to make the below work without the remove.
import os
open('m.py','wt').write(r'def f(str): print "Sooo Original : %s"%(str)')
import m
m.f('Original')
os.remove('m.pyc')
open('m.py','wt').write(r'def f(str): print "Not so original : %s"%(str)')
m = reload(m)
m.f('Copy')
