def _printf(fmt, *args, **print3opts):
'''Formatted print to sys.stdout or given stream.
*print3opts* -- print keyword arguments, like Python 3.+
'''
if print3opts: # like Python 3.0
f = print3opts.get('file', None) or sys.stdout
if args:
f.write(fmt % args)
else:
f.write(fmt)
f.write(print3opts.get('end', linesep))
if print3opts.get('flush', False):
f.flush()
elif args:
print(fmt % args)
else:
print(fmt)
评论列表
文章目录