Mistři v programování na #hovnokod

Python #350

def generate(_len = None, sg = None):
  if sg == None:
    sg = 'aoeuizxcvbn_msdfghjklqwrt_yp123456_7890'
  if _len == None:
    _len = random.Random().randint(1, 100)
  s = ''
  l = len(sg)
  while _len > 0:
    s += sg[random.Random().randint(0, l - 1)]
    _len -= 1
  return s

def loadsrvlists(file, srvlist = {}, prtlist = {}):
  prtlist[0] = 5222
  f = open(file)
  while True:
    s = f.readline().strip()
    if s:
      sr = s[:s.find(':')]
      pr = s[s.find(':') + 1:]
      if not sr in srvlist:
        srvlist[sr] = True
        if pr != prtlist[0]:
          prtlist[sr] = int(pr)
    else: break
  return [srvlist, prtlist]

HovnoKod,