UnicodeEncodeError: 'ascii' codec can't encode character in position 0: ordinal not in range(128)

前端 未结 4 1882
一整个雨季
一整个雨季 2020-12-04 18:00

I\'m working on a Python script that uses the scissor character (9986 - ✂) and I\'m trying to port my code to Mac, but I\'m running into this error.

The scissor char

4条回答
  •  青春惊慌失措
    2020-12-04 19:03

    in the first line of your file .py you need to add this string, :

    # -- coding: utf-8 --

    and you can also try this:

    print ("|\t ",unichr(9986),"PySnipt'd",unichr(9986),"\t|")

提交回复
热议问题