Apr-01-2021, 12:00 AM
So how do I make a print without newline and have it wait in between print?
My current code:
My current code:
print("=", end= '') time.sleep(3) print("=")
How to make print without newline but wait in between each print?
|
Apr-01-2021, 12:00 AM
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("=")
Apr-01-2021, 12:41 AM
A hint. end=''
Apr-01-2021, 12:44 AM
I don't understand.
Apr-01-2021, 02:45 AM
(This post was last modified: Apr-01-2021, 02:45 AM by BashBedlam.)
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: Thanks! But how do I add another print on the same line using this same code, or do I just add another flush?
Apr-01-2021, 09:57 PM
Can you explain more about what you want to accomplish? You can add as many print() function calls as you want.
Apr-01-2021, 09:59 PM
Actually I found it out. Just add another flush statement to the one above the other print statement.
|
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
print doesnt work in a function | ony | 2 | 233 |
Mar-11-2024, 12:42 PM Last Post: Pedroski55 |
|
print(0.1+0.2==0.3) | akbarza | 3 | 294 |
Mar-04-2024, 02:02 PM Last Post: Gribouillis |
|
problem with print command in super() | akbarza | 5 | 503 |
Feb-01-2024, 12:25 PM Last Post: deanhystad |
|
problem with spliting line in print | akbarza | 3 | 335 |
Jan-23-2024, 04:11 PM Last Post: deanhystad |
|
Last record in file doesn't write to newline | gonksoup | 3 | 364 |
Jan-22-2024, 12:56 PM Last Post: deanhystad |
|
problem with print lists | MarekGwozdz | 4 | 612 |
Dec-15-2023, 09:13 AM Last Post: Pedroski55 |
|
Facing issue in python regex newline match | Shr | 6 | 1,141 |
Oct-25-2023, 09:42 AM Last Post: Shr |
|
What a difference print() makes | Mark17 | 2 | 517 |
Oct-20-2023, 10:24 PM Last Post: DeaD_EyE |
|
elif not responding on print | EddieG | 3 | 821 |
Jul-20-2023, 09:44 PM Last Post: Pedroski55 |
|
print(data) is suddenly invalid syntax | db042190 | 6 | 1,119 |
Jun-14-2023, 02:55 PM Last Post: deanhystad |