>Use the __import__() builtin function: > > module = __import__('mymod') Is there a way to manipulate the resulting 'mymod.__name__'? If - against normal behavior - it could be set to '__main__' the imported 'mymod' could be deceived leading to execution of code in the common common if __name__ == '__main__': pass # do something clause. Martin