python2.X中print不输出回车的两种方法

之前一直用sys.stdout.write,如

sys.stdout.write("hellow word")  

 

今天看到另一种方法,最后添加一个逗号“,”,就可以不输出回车

print "hello word", 

 

注:可能没有输出,要sys.stdout.flush()刷新下

 

 

 

你可能感兴趣的:(python)