import code def interact(): foo = 'this is foo' bar = 'this is bar' code.interact(banner='', local=locals()) if __name__ == '__main__': interact()