Python Forum

Full Version: How to make print without newline but wait in between each print?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So how do I make a print without newline and have it wait in between print?
My current code:
print("=", end= '')
time.sleep(3)
print("=")
A hint. end=''
I don't understand.
If I understand the problem correctly, you need to flush the print buffer after the first print statement. Try this:

import time
print("And now for something ", end= '', flush = True)
time.sleep(3)
print("complely different.")
(Apr-01-2021, 02:45 AM)BashBedlam Wrote: [ -> ]If I understand the problem correctly, you need to flush the print buffer after the first print statement. Try this:

import time
print("And now for something ", end= '', flush = True)
time.sleep(3)
print("complely different.")

Thanks! But how do I add another print on the same line using this same code, or do I just add another flush?
Can you explain more about what you want to accomplish? You can add as many print() function calls as you want.
Actually I found it out. Just add another flush statement to the one above the other print statement.