repalce print function with sys.stdout.write