Generally speaking, this is a coding problem
The problem can be solved by sacrificing big killers
# coding: utf-8
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
print '你好'
>>>你好
But today we are talking about another problem
Running in sublime is [decode error – output not UTF-8]
There is no problem running under CMD
The code is as follows
# coding: utf-8
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
print "GOOD-成功"
cmdDown
Delete
#The coding is fine, it's a bug in sublime
#Change it to print "GOOD-success-GOOD" and it will be fine
#The solution is to put a space at the end
print "GOOD-Success"
#Tested several positions and they all work
print "success-GOOD"
print "success-GOOD-success"
#Summarize that you can't start with Chinese and end with Chinese
Similar Posts:
- Cannot read property ‘data’ of undefined;at api showModal success callback function
- Python solves the problem of NameError: name ‘reload’ is not defined
- [Solved] Typeerror: incorrect padding occurred in python3 Base64 decoding
- ZABBIX 2.4 can’t connect to the database [How to Solve]
- Conda Install Error: Solving environment: failed with initial frozen solve.
- Solutions to the problem that image webpack loader cannot be installed or the installation is stuck
- Rabbitmq error of connecting the native idea to Linux: java.net.connectexception: connection timed out: Connect [Solved]
- The full calendar obtains the events report uncaught type error: callback is not a function from the background
- Uniapp cloud storage {“errmsg”: “cloudpath is illegal”}
- [Solved] Nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument