Python 3, the print statement is actually a function and you can do the following:
print('.', end='')
You may also flush the output in case, you are having some problem with buffering:
print('.', end='', flush=True)
For Python 2.6 and higher, You can use the print(‘.’, end=’’) function by importing from __future__ import print_function
For Python 2, you can use the print(‘.’, end=’’) function provided you have used from __future__ import print_function but the flush keyword is not available in Python 2 so you have to flush it manually using the sys.stdout.flush() .
The simplest way is:
import sys
sys.stdout.write('.')
Then to flush stdout use:
sys.stdout.flush()
Hope this helps!