I ran a python script to write my log files using:
nohup python my_script.py >> log.txt
However, I thought maybe it is >>
in Linux which doesn't support the Chinese characters encoded in utf-8
.
In my script I used print
to show the utf-8
characters and it works well in the python shell. So I want to know how can I write the utf-8
characters to log files correctly? Thanks.