Python-Version

1. Python版本
	1.1 python --version
	1.2 Python 2 vs 3 comparison
	1.3 python 2 to 3 converter
2. Python 手册
	2.1 最新官方中文手册
	2.2 learn python
	2.3 Python 风格指南 - 内容目录
3. Python软件
	3.1 Python软件清单
	3.2 Python开发环境
	3.3 Python IDE对比
4. see also

1. Python版本

1.1 python --version

$ python --version
Python 3.8.2
https://en.wikipedia.org/wiki/History_of_Python#Table_of_versions

1.2 Python 2 vs 3 comparison

Comparison Python 3 Python 2
最早发行版本 V3.0 2008 V2.0 2000
最新发行版 V3.8.2 2020 V2.7 2010, 2020已停止更新
print print (“hello”) print “hello”
整数除法 Division 得到浮点数 总是整数
Unicode 支持 字符串默认Unicode 要存储Unicode字符串,需使用”u”定义
语法 Syntax 语法简单易懂 语法相对难以理解
排序比较规则 简化了排序比较规则 非常复杂
迭代 Iteration 新的range()函数来执行迭代 xrange()用于迭代
例外情况 应将其括在括号中 包含在符号中
变量泄漏 变量的值永远不变 在for循环中使用全局变量时,其值会更改。
兼容 Compatibility 将python 2移植到python 3并不难,不过不太可靠 Python版本3与Python 2向后不兼容。
库 Library 越来越多... 很多已经不再更新,淘汰中...
不等运算符 != != 和 <>
True, False True, False 变为2个关键字。
不允许重新赋值。修正了版本2的缺陷
True, False是2个全局变量,数值对应0,1;
变量可以指向其他对象: True = False
nonlocal 新增关键字 nonlcoal,使得非局部变量成为可能。  
Comparison Python 3 Python 2 备注
编码 >>> import sys
>>> sys.getdefaultencoding()
'utf-8'
# 默认使用 utf-8, 所以如下是合法的
>>> 中国 = 'china'
>>>print(中国)
china
>>> import sys
>>> sys.getdefaultencoding()
'ascii'
# 默认ascii, 代码顶部包含 # coding=utf-8
>>> str = u"中国"
>>> str
u'u4e2du56fd'
>>> import sys
>>> sys.getdefaultencoding()
'ascii'
>>> reload(sys)
<module 'sys' (built-in)>
>>> sys.setdefaultencoding("utf-8")
>>> sys.getdefaultencoding()
'utf-8'
字符串 str, 字符串;byte, 字节序列。
任何需要写入文本或者网络传输的数据都只接收字节序列,这就从源头上阻止了编码错误的问题。
unicode, 文本字符串;srt, 字节序列。
不过两者并没有明显的界限
=转换= ; =作用=
=字节= byte str encode ; 存储, 传输
=字符= str unicode decode ; 展示

reference:
https://www.guru99.com/python-2-vs-python-3.html#7

Python2.x与3​​.x版本区别:
https://www.runoob.com/python/python-2x-3x.html
Python的3​​.0版本,常被称为Python 3000,或简称Py3k。相对于Python的早期版本,这是一个较大的升级。为了不带入过多的累赘,Python 3.0在设计的时候没有考虑向下相容。

Python 2 和 Python 3 有哪些主要区别?
https://www.zhihu.com/question/19698598

1.3 python 2 to 3 converter

2to3 - Automated Python 2 to 3 code translation
https://docs.python.org/2/library/2to3.html

2to3 - 自动将 Python 2 代码转为 Python 3 代码
https://docs.python.org/zh-cn/3/library/2to3.html

https://www.pythonconverter.com/

2. Python 手册

2.1 最新官方中文手册

https://docs.python.org/zh-cn/3/tutorial/classes.html v3.8.2 (2020)

历史版本:
https://www.runoob.com/python3/python3-tutorial.html v3.3.2 (2013)
https://www.runoob.com/manual/pythontutorial3/docs/html/ v3.6.3 (2017)
https://www.runoob.com/python/python-tutorial.html v2.7 (2010)

2.2 learn python

https://www.learnpython.org/
https://www.techbeamers.com/python-tutorial-step-by-step/

2.3 Python 风格指南 - 内容目录

https://zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/contents/
https://github.com/zh-google-styleguide/zh-google-styleguide/tree/master/google-python-styleguide
https://github.com/google/styleguide
https://google.github.io/styleguide/pyguide.html

3. Python软件

3.1 Python软件清单

https://en.wikipedia.org/wiki/List_of_Python_software

3.2 Python开发环境

https://en.wikipedia.org/wiki/Python_(programming_language)#Development_environments
https://zh.wikipedia.org/wiki/Python#开发环境

3.3 Python IDE对比

https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#Python

IDE 跨平台 Written in 小部件工具包 License Python2x支持 Python3x支持 Debugger GUI生成器 集成工具链 探查器 代码覆盖率 自动完成 静态程序分析 基于GUI的设计 类浏览器 代码重构 版本控制系统支持 Web框架支持
IDLE Python Tkinter PSFL Yes Yes Yes Yes Unknown No No Yes No Yes Yes Unknown No No
eric Python PyQt GPLv3 "or later" Yes Yes Yes Yes: Qt Unknown Yes Yes Yes Pylint via Yes Yes Yes Git, Mercurial, SVN Django plug-in
PyCharm Java Swing Apache License 2.0 Yes Yes Yes Unknown Yes Yes . Yes . Yes Yes . Yes Yes Yes Yes Yes
PyDev / LiClipse Unknown SWT EPL Yes Yes Yes Unknown Unknown Unknown Unknown Yes Yes Unknown Yes Yes Yes Unknown
Visual Studio Code JavaScript HTML MIT License Yes Yes Yes No Unknown Yes Unknown Yes Unknown Unknown Unknown Unknown Yes Yes
Spyder Python PyQt, PySide MIT License Yes 2.7 Yes Yes No Yes Yes No Yes Yes Unknown Beta Planned Partial No
Thonny Python Tkinter MIT License No Yes Yes No No No No Yes Yes Unknown Yes No No Flask
Wing Python Qt5 with PyQt Proprietary Yes Yes Yes . No Yes No No Yes Yes Yes Yes Yes Yes Yes
KDevelop C, C++ Qt GPL Unknown Yes Yes Unknown Unknown Unknown Unknown Yes Unknown Unknown Yes Yes Git, Mercurial, SVN
Bazaar, CVS
Unknown
Geany C GTK+ GPL Unknown Yes No Unknown Unknown Unknown Unknown Yes Unknown Unknown Unknown Unknown Unknown Unknown


4. see also

https://wiki.archlinux.org/index.php/Python
https://wiki.gentoo.org/wiki/Python
https://wiki.postgresql.org/wiki/Python

 
原文地址:https://www.cnblogs.com/sztom/p/12694509.html