ZerG
+login6:-:password:
login7::+:password
login8:-:password:
и все пропало
Где?
>>> def check_log(login):
... """проверяем логин, если норм возвращаем True"""
... return True
...
>>> def check_pass(password):
... """проверка"""
... return True
...
>>> txt = """\
... login:password
... asdasd-!asd1321@
... login2:password2
... login3:password3
... login+password
...
... +login6:-:password:
... login7::+:password
... login8:-:password:
...
... login4:password4
... login5:password5\
... """
>>>
>>> out = ''
>>>
>>> for line in txt.splitlines():
... if line.count(':') == 1:
... login, password = line.split(':')
... if check_log(login) and check_pass(password):
... out += '{}:{}\n'.format(login, password)
...
>>> print(out)
login:password
login2:password2
login3:password3
login4:password4
login5:password5
>>>
ZerG
и все пропало
Не, они просто невалидные и всё.