Hi,
I have facing an issue with python while printing a characher without new line.
I want to print a "." to show progress of a search operation.
Simple code to demonstrate the problem is
I am expecting to see a "." after every sleep/for every iteration. However I can see it only when the loop ends or i kill the run.
Output :
c:\Python30>pyt hon.exe c:\Users\ss001\ Desktop\PythonS cript\try.py
..Traceback (most recent call last):
File "c:\Users\ss001 \Desktop\Python Script\try.py", line 4, in <module>
time.sleep(10)
KeyboardInterru pt
I have facing an issue with python while printing a characher without new line.
I want to print a "." to show progress of a search operation.
Simple code to demonstrate the problem is
Code:
import time
for i in range(10):
print(".",end="")
time.sleep(10)
Output :
c:\Python30>pyt hon.exe c:\Users\ss001\ Desktop\PythonS cript\try.py
..Traceback (most recent call last):
File "c:\Users\ss001 \Desktop\Python Script\try.py", line 4, in <module>
time.sleep(10)
KeyboardInterru pt
Comment