老男孩Python 3.5学习第一周

Python缺点:不能利用多CPU,GIL即全局解释器锁(Global Interpreter Lock)是计算机程序设计语言解释器用于同步线程的工具,使得任何时刻仅有一个线程在执行,Python线程是操作系统的原生线程。

字符编码:

ASCII(American Standard Code for Information Interchange),每个字符1字节。

1980年,GB2312

1995年,GBK 1.0

2000年,GB18030

Unicode,216 表格空间,支持中文,每个字符2字节。

UTF-8,每个英文字符1字节;每个中文字符3字节。

Python技法:

Python 2.x 支持中文:#-*-coding:utf-8-*-

'''   '''三引号,打印多行。

%,占位符

{}.format(),可指定参数,也可不指定。

密码密文:inport getpass \n passwrod = getpass.getpass('password:') \n #Pycharm 中不好用……

for i in range(0,10,2),步长。

continue,跳出本次循环,继续下一循环。

猜你喜欢

转载自www.cnblogs.com/lsj000jsl/p/10115864.html
今日推荐