浏览 364
已结题

为什么报错NameError: name 'GBK' is not defined?如何解决?

# coding=utf-8
import sys
a_utf8='人生苦短'
a_gbk=a_utf8.encode(GBK)
print ('a_gbk')
C:\Users\zbj15010857936\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/zbj15010857936/PycharmProjects/pythonProject/main.py
Traceback (most recent call last):
  File "C:/Users/zbj15010857936/PycharmProjects/pythonProject/main.py", line 4, in <module>
    a_gbk=a_utf8.encode(GBK)
NameError: name 'GBK' is not defined

Process finished with exit code 1

3条回答 默认 最新

相关推荐 更多相似问题