04 2018 档案
python之json序列
摘要:# from urllib import request## f=request.urlopen("http://123.178.101.29:81/xs_main.aspx?xh=201512102028")## result=str(f.read(),encoding='gb2312')# pr 阅读全文
posted @ 2018-04-30 11:06 guodashen 阅读(154) 评论(0) 推荐(0)
python 字符串格式化
摘要:#字符串#老式的字符串格式化%,按照顺序 例如:# s="i am %s ,age %d"%('alex',18)# print(s)#加号表示右对齐,减号表示左对齐,如果是0的话,必须是数字即%04d# s="i am %(n1)+10s,age %(n2)+10d"%{"n1":'alex',' 阅读全文
posted @ 2018-04-30 08:49 guodashen 阅读(100) 评论(0) 推荐(0)
python 基础知识
摘要:数据类型的获取type()函数、isinstance()函数 join 连接字符串 方法"_".join("要加的字符串");ljust 内容左对齐,右侧填充lower 把字符串变小写lstrip 移除右边的空格rstrip 移除右边的空格strip 移除所有的空格replace 替换s.repla 阅读全文
posted @ 2018-04-28 19:07 guodashen 阅读(150) 评论(0) 推荐(0)
python模块
摘要:模块sys模块(和解释器相关的模块) 模块之导入模块: import sys sys.path.append("D:"); for i in sys.path: print(i) 模块之os模块(和系统相关的模块) import osstr1='D:'str2='home'str3='index't 阅读全文
posted @ 2018-04-28 18:51 guodashen 阅读(83) 评论(0) 推荐(0)
python学习笔记
摘要:********# f=open("haha","a")# data=f.write(bytes("中国",encoding="utf-8"))# f.close()#文件的写入 #文件的读取操作f=open("haha","r",encoding="utf-8")data=f.read()f.cl 阅读全文
posted @ 2018-04-11 16:08 guodashen 阅读(98) 评论(0) 推荐(0)