python 2.x 和python3.x 区别

运行第一个py文件:

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

 

 

posted @ 2019-02-01 09:54  2019在路上  阅读(175)  评论(0)    收藏  举报