摘要: menu = { '北京': { '海淀': { '五道口': { 'soho': {}, '网易': {}, 'google': {} }, '中关村': { '爱奇艺':... 阅读全文
posted @ 2017-11-09 15:48 黄骁瀚cerny 阅读(311) 评论(1) 推荐(0) 编辑
摘要: 老男孩教育(www.oldboyedu.com) xtrabackup中小企业MySQL Xtrabackup物理增量恢复案例实战条件: 1.具备全量备份(xtrabckup备份的全备)。 2.具备全量之后的所有增量备份(xtrabckup备份的增量)。 3.具备最后一次增量备份以后的所有My 阅读全文
posted @ 2017-11-09 15:16 黄骁瀚cerny 阅读(930) 评论(0) 推荐(0) 编辑
摘要: Python 的字符串常用内建函数如下: capitalize()将字符串的第一个字符转换为大写 center(width, fillchar) count(str, beg= 0,end=len(string)) bytes.decode(encoding="utf-8", errors="str 阅读全文
posted @ 2017-11-09 14:51 黄骁瀚cerny 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 一、选择题(32分) 1、python不支持的数据类型有 A A、char B、int C、float D、list 2. E x = “foo” y = 2 print(x+y) A.foo B.foofoo C.foo2 D.2 E.An exception is thrown 3、关于字符串下列说法错误的是 B A、字符应该视为长度为1的字符串 B、字符串以\0标志字符... 阅读全文
posted @ 2017-11-07 18:54 黄骁瀚cerny 阅读(7725) 评论(0) 推荐(0) 编辑
摘要: 1、执行 Python 脚本的两种方式 终端和交互模式 法1:python helloword.py 法2:ps: 执行前需给预chmod 755 helloword.py (linux系统中)./helloword.py 2、简述位、字节的关系1byte =8位 3、简述 ascii、unicod 阅读全文
posted @ 2017-11-05 14:20 黄骁瀚cerny 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 功能要求: 要求用户输入总资产,例如:2000 显示商品列表,让用户根据序号选择商品,加入购物车 购买,如果商品总额大于总资产,提示账户余额不足,否则,购买成功。 附加:可充值、某商品移除购物 goods = [ {"name": "电脑", "price": 1999}, {"name": "鼠标 阅读全文
posted @ 2017-11-03 15:33 黄骁瀚cerny 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 1:#r模式,在文件不存在时,不会创建新的文件 f = open('a.txt','r',encoding = 'utf-8') 2:字符编码 什么是字符编码? 把人类的字符翻译成计算机能认识的数字 什么是字符编码表? ASCII GBK UTF-8 Unicode unicode >encode( 阅读全文
posted @ 2017-11-03 15:32 黄骁瀚cerny 阅读(187) 评论(0) 推荐(0) 编辑
摘要: ##此时需要导入os模块import oswith open('old.txt','r',encoding = 'utf-8') as read_f,\open('new.txt','w',encoding = 'utf-8') as write_f: for line in read_f: if 阅读全文
posted @ 2017-11-03 15:31 黄骁瀚cerny 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 从文件读取size个字符,当未给定size或给定负值的时候,读取剩下所有的字符, 然后作为字符串返回 文件的读取方法很多,可以使用文件对象的read()和readline()方法,也可以直接list(f)或者直接使用迭代来读取。read()是按字节为单位读取,如果不设置参数,那么会全部读取出来,文件 阅读全文
posted @ 2017-11-03 15:30 黄骁瀚cerny 阅读(106) 评论(0) 推荐(0) 编辑
摘要: ##open将操作系统发起请求,操作系统完成请求,# f = open('old.txt','r',encoding = 'utf-8')# res = f.read()# print(res)# f.close() # f = open('old.txt','r',encoding = 'utf- 阅读全文
posted @ 2017-11-03 15:29 黄骁瀚cerny 阅读(124) 评论(0) 推荐(0) 编辑