How to flush the output data to write the output on the screen in Python

2 Answers

0 votes
import sys

sys.stdout.write("python programming")

sys.stdout.flush()
 

    
    
'''
run:

python programming

'''

 



answered Apr 9, 2021 by avibootz
0 votes
print("python programming", flush = True)
 

    
    
'''
run:

python programming

'''

 



answered Apr 9, 2021 by avibootz

Related questions

1 answer 283 views
283 views asked Nov 12, 2016 by avibootz
1 answer 255 views
1 answer 196 views
1 answer 1,699 views
...