直接执行
python hello.py
指定解释器
#!/usr/bin/env python
print "hello,world"
给予执行权限:chmod 755 hello.py 运行脚本 ./hello.py
字符编码- ASCII
- gb2301
- GBK
- GB18030
- unicode 2bytes
- utf-8 en:1byte zh:3bytes
1、getpass模块:隐藏输入字符(终端可用) 2、三引号(”“”“”“):作用一:多行注释,作用二:多行文本 3、循环 - for …else - while…else 4、判断 if…elif…else 5、格式化输出 (1)字符串拼接+ (2)%元组 (3)format槽位 (4)format字典 6、break结束当层循环,continue跳过本次循环 7、默认编码:utf-8