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 199 views
199 views asked Nov 12, 2016 by avibootz
1 answer 175 views
1 answer 110 views
1 answer 1,594 views
1 answer 162 views
162 views asked Jun 11, 2015 by avibootz
...