最近好多Python新书都是用Python 3,是时候啦,请问现在还有什么只能在2下面才能做的吗
|
1
|
|
ushuzAug 2, 2013
2
Unicode还有许多坑在前面等着你,加油!
|
|
thedevil5032Aug 3, 2013 via iPad
4
关键看你需要什么库。
我之前一直只用 Python Standard Library 和 PyQt,Python 3 完全没问题。 现在学 Python 的 Web 框架,Flask,还是老老实实用 Python 2。 |
|
wuxqingAug 3, 2013
5
新版的Flask好像是支持py3的
|
|
raptorAug 3, 2013
6
@thedevil5032 bottle支持py3
|
|
thedevil5032Aug 3, 2013 via iPad
7
@wuxqing 请仔细阅读文档。
http://flask.pocoo.org/docs/advanced_foreword/#the-status-of-python-3 咩。简单说,支持,但是官方强烈推荐 Python 2。 @raptor 这个我是知道的,但还是谢谢你。 |
|
sandtearsAug 3, 2013
8
基本上私的习惯是,所有字符串开始就定义成utf-8,需要输出的时候或者编码的时候才会encode
|
|
MuninnAug 3, 2013
9
从今年开始 绝大多数都支持py3了
|
|
10
用了 python3 后编码问题几乎很少遇到了。
用了 node js 后 python 异步编程里的大多数困扰的问题几乎没遇到了。 |
|
funagiAug 3, 2013
11
from __future__ import unicode_literals
可解否? |
|
wodemyworldAug 3, 2013
12
全面发动第三次世界大战,最后统一为一个国家一个民族,然后编码的问题就再也不是问题了
|
|
clowwindyAug 3, 2013 via iPhone
14
除了检测用户名合法性的时候,不用 unicode,只用 str 路过
|
|
15
真正理解unicode及其编码,用py2也没啥问题。不理解的,py3也救不了你
|
|
EverAug 4, 2013
17
python3不就把python2的unicode改成str, 把python2的str改成bytes么, 用法上又没什么实质变化
@thedevil5032 'We strongly recommend using Python 2.6 and 2.7 with activated Python 3 warnings during development.' 是建议你开发用python2的时候打开python3的警告, 写起来注意可以减少以后迁移到python3的麻烦, 你怎么解读成建议你用python2了 |