摘要: #写入new文件 import json dic = {'name':'alex'} i = 8 s = 'hello' l = [11,22] f = open("new_hello","w") date = json.dumps(dic) f.write(date) #读取信息 f_read = open("new_hello","r") data = json.loads(f_read.... 阅读全文
posted @ 2016-12-13 15:55 打不死的--蟑螂 阅读(211) 评论(0) 推荐(0) 编辑
摘要: #写入new文件 import json dic = {'name':'alex'} i = 8 s = 'hello' l = [11,22] f = open("new_hello","w") date = json.dumps(dic) f.write(date) 阅读全文
posted @ 2016-12-13 15:54 打不死的--蟑螂 阅读(148) 评论(0) 推荐(0) 编辑
摘要: import time print(time.strftime("%Y,%m,%d %X",time.localtime())) 阅读全文
posted @ 2016-12-13 10:09 打不死的--蟑螂 阅读(387) 评论(0) 推荐(0) 编辑
摘要: import random item = [1,2,4,5,8,5,9] random.shuffle(item) print(item) 阅读全文
posted @ 2016-12-13 10:08 打不死的--蟑螂 阅读(138) 评论(0) 推荐(0) 编辑
摘要: import random def v_code(): code = '' for i in range(5): num = random.randint(0,9) alf = chr(random.randint(65,122)) add = random.choice([num,alf]) ... 阅读全文
posted @ 2016-12-13 10:06 打不死的--蟑螂 阅读(106) 评论(0) 推荐(0) 编辑