<分区>
Possible Duplicates:
Is it advisable to go with Python 3.1 for a beginner?
What version of Python should I use if I’m a new to Python?
还没有真正用 Python 做过任何东西...我应该掌握哪种 Python? 2.X 还是 3.X?
标签 python
<分区>
Possible Duplicates:
Is it advisable to go with Python 3.1 for a beginner?
What version of Python should I use if I’m a new to Python?
还没有真正用 Python 做过任何东西...我应该掌握哪种 Python? 2.X 还是 3.X?
最佳答案
2.X
仍然提供范围更广的第三方库/框架、教学网站和书籍,以及帮助您的专家——我预计这将持续几年直到3.X
逐渐超越它。因此,现在我仍然会推荐 2.X
,尽管 3.x
的“干净”和简单性更高(因为 2.x 有一些不足之处必须热衷于向后兼容,最终在 3.x 中消失了)。顺便说一下,3.x 的新特性中很少有没有向后移植到 2.x 中的——例如,如果您希望 print
成为一个函数,就像在 3.x 中一样,在您的2.6 或 2.7 模块,只需在模块的开头放置语句
from __future__ import print_function
“从 future 导入”是一种典型的 Python 方式,可以在明确请求时提供新功能,而不会破坏向后兼容性。
关于python - 我应该使用哪种 Python?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3121693/
相关文章:
python - 自定义环境的 Tensorflow 2.0 DQN 代理问题
python - 在 Python 中建模 4-D 数据(带时间戳)
python - 使用 Python 3 通过 way2sms 发送短信
python - Pandas Dtypewarning : How do I find the dtype of different cells in a column?
python - Django 过滤对象 F ('duration' ) 从现在开始
python - 仅通过电子邮件地址使用 gmail api 访问用户个人资料信息