Rumah > Soal Jawab > teks badan
黄舟2017-04-17 17:04:42
在python文件前加上这段代码
import sys
default_encoding = 'utf-8'
if sys.getdefaultencoding() != default_encoding:
reload(sys)
sys.setdefaultencoding(default_encoding)
PHPz2017-04-17 17:04:42
突然发现我当时写的是一个笨方法,
email=StringField('电子邮箱‘.decode('utf-8'),validators=[Required(),Length(1,64),Email()])
password=PasswordField('密码'.decode('utf-8'),validators=[Required()])
remember_me=BooleanField('记住我?'.decode('utf-8'))