2017年3月11日

摘要: python如何访问互联网 url+lib==urllib url protocol://hostname[:port]/path/[;parameters][?query][#fragement] protocol:http https ftp file ed2k 服务器域名/ip 资源地址 ur 阅读全文
posted @ 2017-03-11 17:09 echoshao 阅读(259) 评论(0) 推荐(0) 编辑
 
摘要: 容器-->数据封装 函数-->语句封装 类-->方法属性封装 模块-->程序.py 命名空间 导入模块 TemperatureConvert.py 第一种:import 程序 第二种 from 模块 import 函数 第三种 import 模块 as 新名字(推荐) 阅读全文
posted @ 2017-03-11 16:13 echoshao 阅读(206) 评论(0) 推荐(0) 编辑
 
摘要: import time as t class MyTimer(): def __init__(self): self.unit = ['年', '月', '日', '时', '分', '秒'] self.prompt = "未开始计时" self.lasted = [] self.start = 0 self.stop = 0 def __st... 阅读全文
posted @ 2017-03-11 15:47 echoshao 阅读(456) 评论(0) 推荐(0) 编辑
 
摘要: 对象 = 属性+方法 面向对象特征(封装继承多态) 不同对象对同一动作有不同反应 魔法方法__: 公有 name 私有__name 组合:把没有实现关系的多个类放在一个类中 类,类对象,实例对象 常用BIF issubclass(A,B) issubclass(A,object) isinstanc 阅读全文
posted @ 2017-03-11 15:21 echoshao 阅读(112) 评论(0) 推荐(0) 编辑
 
摘要: EasyGui(easygui-docs-0.96\tutorial\index.html) 阅读全文
posted @ 2017-03-11 14:34 echoshao 阅读(252) 评论(0) 推荐(0) 编辑
 
摘要: 你不可能总是对的(Exception) 常用标准异常 try-except语句 raise 代码自己引发异常 raise ZeroDivisionError('除数为零') 阅读全文
posted @ 2017-03-11 14:16 echoshao 阅读(127) 评论(0) 推荐(0) 编辑
 
摘要: 将对象转为二进制字节流(pickle) 二进制转为对象 实例 1泡菜化(持久化)城市字典 2获取城市字典 阅读全文
posted @ 2017-03-11 13:46 echoshao 阅读(354) 评论(0) 推荐(0) 编辑