python 2.x 和python3.x 区别

运行第一个py文件:

python3x :python 文件路径 回车
python2x :python2 文件路径 回车
python2 python3 区别:python2默认编码方式是ascii码
解决方式:在文件的首行:#-*- encoding:utf-8 -*-或# -*- coding: utf-8 -*-
python3 默认编码方式utf-8

猜你喜欢

转载自www.cnblogs.com/laoyw/p/10344840.html
今日推荐