import sys out = sys.stdout sys.stdout = open("help.txt","w") help(help) sys.stdout.close() sys.stdout =out exit()