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 194 views
194 views asked Nov 12, 2016 by avibootz
1 answer 165 views
1 answer 100 views
1 answer 1,588 views
1 answer 156 views
156 views asked Jun 11, 2015 by avibootz
...