myfile = open("wrsu"+str(i)+'_'+str(j)+'_'+str(TimesToExec)+".txt",'w')
sys.stdout = myfile
p1 = subprocess.Popen([pathname,"r", "s","u",str(i),str(j),str(runTime)],stdout=subprocess.PIPE)
output = p1.communicate()[0]
print output,
When I use this to redirect the output of a exe to my own file, it always
a carriage return after each line, How to suppress it?