def unload_module(modname):
 for (m, pm) in mpstate.modules:
  if (m.name == modname):
   if hasattr(m, 'unload'):
    m.unload()
   mpstate.modules.remove((m, pm))
   print ('Unloaded module %s' % modname)
   return True
 print ('Unable to find module %s' % modname)
 return False

def unload_module ( modname ) : for ( m , pm ) in mpstate . modules : if ( m . name == modname ) : if hasattr ( m , 'unload' ) : m . unload ( ) mpstate . modules . remove ( ( m , pm ) ) print ( 'Unloaded module %s' % modname ) return True print ( 'Unable to find module %s' % modname ) return False
removes a module .