上一页 1 ··· 5 6 7 8 9 10 11 12 13 14 下一页
摘要: xml 模块 是实现不同语言或程序之间进行数据交换的协议,json的前辈 创建xml 文档 》》》 阅读全文
posted @ 2019-05-16 20:35 小圣庄 阅读(124) 评论(0) 推荐(0) 编辑
摘要: pickle模块 test2.txt 中如果是 {"name":"sxj","age":"18"} 注意双引号 运行 成功 如果test2.txt 中是单引号 则运行失败。注意 json 中load和dump 不需要配对使用,只要符合json 语句规则 就能load pickle 使用方法同json 阅读全文
posted @ 2019-05-12 10:23 小圣庄 阅读(109) 评论(0) 推荐(0) 编辑
摘要: json.loads 能将不同语言转换成python对象 类似于eval 但是比其更强大。 pickle python语言转换成python语言 json.dumps(): 对数据进行编码。 json.loads(): 对数据进行解码。 如果你要处理的是文件而不是字符串,你可以使用 json.dum 阅读全文
posted @ 2019-05-08 21:40 小圣庄 阅读(98) 评论(0) 推荐(0) 编辑
摘要: >> (venv) penghuadeMacBook:untitled miaowu$ python study/hello.py get sxj['study/hello.py', 'get', 'sxj']get sxj输入了get命令 阅读全文
posted @ 2019-05-05 20:26 小圣庄 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 有个代码名称为 test1.py,它的所在路径为 D:\test 下面。那我只需要完成以下步骤就可以把它作为模块 import 到其他代码中了。 1.import sys 2.sys.path.append("D:\\test")#临时修改 如果要永久修改,需要修改 windows的环境变量-系统变 阅读全文
posted @ 2019-05-04 10:50 小圣庄 阅读(143) 评论(0) 推荐(0) 编辑
摘要: from ***import*** eg:from my_module import cal #从my_module引入cal eg:from cal import * #导入全部 如果导入的文件在很多包下 则 可以: eg: from web.web1.web2.web3 import cal e 阅读全文
posted @ 2019-05-03 12:02 小圣庄 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 模块 1.python 标准模块 2.第三分模块 3.应用程序自定义模块 import: 1.执行文件 2.引入变量名 bin.py main.py cal.py 阅读全文
posted @ 2019-05-02 13:37 小圣庄 阅读(148) 评论(0) 推荐(0) 编辑
摘要: import os def file_h(backend_data,res=None,type='search'): #程序耦合,文件处理功能 单独拿出来 if type=='search': with open ('test2','r') as read_test2: ret = [] tag=False ... 阅读全文
posted @ 2019-05-01 21:05 小圣庄 阅读(139) 评论(0) 推荐(0) 编辑
摘要: import os def search(data): #查询 print('查询功能%s'%data) ret=[] backend_data='backend %s'%data with open ('test2','r') as read_test2: tag=False for read_line in read_te... 阅读全文
posted @ 2019-04-27 21:45 小圣庄 阅读(151) 评论(0) 推荐(0) 编辑
摘要: def search(data): #查询 print('查询功能%s'%data) ret=[] backend_data='backend %s'%data with open ('test2','r') as read_test2: tag=False for read_line in read_test2: ... 阅读全文
posted @ 2019-04-18 21:56 小圣庄 阅读(201) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 14 下一页