怎样使 Python 输出时不换行?

怎样使 Python 输出时不换行?

import sys sys . stdout . write ( '.' ) # 在 python 2.x 下用 python 3 的 print from __future__ import print_function print ( '.' , end = '' ) # ps. 这种写法并不是正确的,会在末尾多一个空格 print '.' ,