Use sys.stdout.write