摘要: 一:json&pickle 模块 json 用于字符串和python数据类型进行转换。因为python中的数据类型不能写入文件,所以需要转换为字符串或者bytes存入文件中 pickle 用于python特有的数据类型和python的数据类型进行转换 json 提供四个功能,dumps,dump,l 阅读全文
posted @ 2018-10-18 23:12 杨fj 阅读(93) 评论(0) 推荐(0)
摘要: 一:os模块: 1.os.getcwd() 1 import os 2 os.getcwd() 3 'C:\\day5' 2.os.chdir() os.chdir('C:\\') os.getcwd() 'C:\\' 3.os.pardir 返回当前目录的父目录 os.pardir '..' 4. 阅读全文
posted @ 2018-10-18 21:26 杨fj 阅读(107) 评论(0) 推荐(0)
摘要: 1.time与datetime 时间戳 1970年1月1日之后的秒,即:time.time() 格式化的字符串 2018-10-17 17:11, 即:time.strftime('%Y-%m-%d') 结构化时间 元组包含了:年、日、星期等... time.struct_time 即:time.l 阅读全文
posted @ 2018-10-18 14:58 杨fj 阅读(111) 评论(0) 推荐(0)