If you want to specify the encoding in python3, you can still use the bytes command as shown below:
import os os.write(1,bytes('Your string to Stdout','UTF-8'))
where 1 is the corresponding regular number for stdout β sys.stdout.fileno ()
Otherwise, if you do not need only the encoding:
import sys sys.stdout.write("Your string to Stdout\n")
If you want to use os.write without encoding, try using below:
import os os.write(1,b"Your string to Stdout\n")
Marco smdm Apr 13 '15 at 13:05 2015-04-13 13:05
source share