From 9955bf13f40e7d72bb9de49bff623d3803f518e7 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Thu, 12 Nov 2020 12:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E7=94=9F=E6=88=90=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=86=85=E5=AE=B9=E4=BD=9C=E4=B8=BA=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=EF=BC=8C=E6=8F=90=E9=AB=98=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E7=81=B5=E6=B4=BB=E6=80=A7=E5=92=8C=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04-CustomLibrary/ipandstring/stringip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/04-CustomLibrary/ipandstring/stringip.py b/04-CustomLibrary/ipandstring/stringip.py index 9a094ba..0ce0c44 100644 --- a/04-CustomLibrary/ipandstring/stringip.py +++ b/04-CustomLibrary/ipandstring/stringip.py @@ -52,12 +52,12 @@ class stringandip (object): print(ipStr) return ipStr - def getstring(self,randomlength=16): + def getstring(self,randomlength=16,base_str='ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz0123456789'): """ 生成一个指定长度的随机字符串 """ random_str = '' - base_str = 'ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz0123456789' + #base_str = 'ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz0123456789' length = len(base_str) - 1 for i in range(randomlength): random_str += base_str[random.randint(0, length)]