亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

python生成隨機(jī)密碼或隨機(jī)字符串的方法

 更新時(shí)間:2015年07月03日 16:01:04   作者:pythoner  
這篇文章主要介紹了python生成隨機(jī)密碼或隨機(jī)字符串的方法,涉及Python字符串及隨機(jī)數(shù)的相關(guān)使用技巧,非常簡單實(shí)用,需要的朋友可以參考下

本文實(shí)例講述了python生成隨機(jī)密碼或隨機(jī)字符串的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

import string,random 
def makePassword(minlength=5,maxlength=25): 
 length=random.randint(minlength,maxlength) 
 letters=string.ascii_letters+string.digits
 # alphanumeric, upper and lowercase 
 return ''.join([random.choice(letters) for _ in range(length)]) 

希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論