import sys# no new linesys.stdout.write("abc")# has new linesys.stdout.write("abc\n") # python2 print statement with comma at the end.print "abc", # python3 print functionprint("abc", end="")
使用sys.stdout.write()输出。