Показать сообщение отдельно

  #10  
Старый 12.12.2011, 01:19
FewG
Познающий
Регистрация: 25.12.2009
Сообщений: 42
С нами: 8620053

Репутация: 12
По умолчанию

Сегодня только писал для одного с форума:

Код:
LIST = [0, 0]

def main():
    COUNT = 0
    isParseAllowed = False    
    
    file = open("text.txt", "r")
        
    for line in file:
        a = line.split(":")     
        if(a[0].strip(" ") == "Host"):
            if(a[2].strip(" ").split("/")[2].strip("\n") in ["vk.com", "vkontakte.ru"]):
                isParseAllowed = True
        elif a[0].strip(" ") == "Login" and isParseAllowed:
            LIST[0] = a[1].strip("\n").strip()
        elif a[0].strip(" ") == "Pwd" and isParseAllowed:
            LIST[1] = a[1].strip("\n").strip()
            COUNT += 1
            isParseAllowed = False
            f = open("accounts.txt", "a")            
            f.write(LIST[0] + ":" + LIST[1] + "\n")
            f.close()
            
            
    print("Done (" + str(COUNT) + " Entries)")

if __name__ == '__main__':
    main()
 
Ответить с цитированием