摘要: 1 可以把list,tuple,dict和string相互转化。 2 ################################################# 3 字符串转换成列表 4 >>>a = "[[1,2], [3,4], [5,6], [7,8], [9,0]]" 5 >>>type(a) 6 7 >>> b = eval(a) 8 >>> print b ... 阅读全文
posted @ 2017-08-08 22:55 前方、有光 阅读(1244) 评论(0) 推荐(0)
摘要: 时间模块 1 def v_code(): 2 code = '' 3 for i in range(8): #产生8个字符 4 num = random.randint(0,9) #num取0-9的数字,头尾都顾 5 alf = chr(random.randint(65,90)) 6 alp = 阅读全文
posted @ 2017-08-08 15:35 前方、有光 阅读(728) 评论(0) 推荐(0)