import sys sys.stdout=open("summary2.txt","w+") print(\'total genes\',Signature_1, len(NameA)) print(\'up genes\',Signature_1,len(upA)) print(\'down