MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)成績的處理。本站提示廣大學習愛好者:(MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)成績的處理)文章只能為提供參考,不一定能成為您想要的結果。以下是MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)成績的處理正文
原來想窮舉一切暗碼,算法要末就嵌套太深,要末就特殊耗內存(會溢出).後來選了一個簡略反復幾率很低的算法.代碼以下:
# -*- coding:utf-8 -*-
'''
@ function: 生成隨秘密碼字典
'''
import random
class Dictor():
CSet=' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&*()_-+=/*<>:;\'"[]{}|'
def __init__(self,minlen,maxlen):
if maxlen>minlen:
self.__minlen=minlen
self.__maxlen=maxlen
else:
self.__minlen=maxlen
self.__maxlen=minlen
def __iter__(self):
return self
def __next__(self):
ret=''
for i in range(0,random.randrange(self.__minlen,self.__maxlen+1)):
ret+=random.choice(Dictor.CSet)
return ret
if __name__=='__main__':
for str in Dictor(6,16):
print(str)