xxxxxxxxxx
print( "a", "b", sep=",", end=",")
print( "c")
# prints
# a,b,c
xxxxxxxxxx
print "We're doing something...",
sys.stdout.flush()
print "Done!" #just add a comma python 2.7 print without newline 2/21/2024
xxxxxxxxxx
## the command \r does this
print('hello', end='\r')
print('bye', end='\r') ## the end='\r' command is what does this.
output:
bye
## it is bye because it immediately rewrites the line with bye.