Delete a function

paul paul at subsignal.org
Wed Mar 21 13:45:01 EDT 2007


gtb schrieb:
> On Mar 21, 11:37 am, Steve Holden <s... at holdenweb.com> wrote:
>> gtb wrote:
>>> After a function has been imported to a shell how may it be deleted so
>>> that after editing it can reloaded anew?
>> Use the built-in reload() function to reload the module that defines the
>> function.
> Thanks, tried that now and get nameError: with the following.
> 
> import sys
> sys.path.append("c:\maxq\testScripts")
> 
> from CompactTest import CompactTest
> from compactLogin import dvlogin
> 
> reload(compactLogin)
you haven't imported compactLogin but dvlogin from the compactLogin
namespace. Try:

import compactLogin
...do something with compactLogin.dvlogin...

reload(compactLogin)

cheers
 Paul




More information about the Python-list mailing list