How to print/store non-ASCII characters (unicode?)

2020-04-24 10:49发布

I am reading in a large file of musicians. Many of these artists have strange characters in their names, as they may be from Germany or some other country with non-ASCII characters. I want to be able to both store these musician names in a list and print them to the console.

How do I print out these strings with strange characters, that are read in from a text file?

2条回答
手持菜刀,她持情操
2楼-- · 2020-04-24 11:39

just include these two line at the top of your code

  1. #!/usr/local/bin/python
  2. # coding: latin-1

go to this link for further details

查看更多
We Are One
3楼-- · 2020-04-24 11:53
登录 后发表回答