Today, East elder brother want to use Scorpio Pro 5 Check the password of the pig farm someone's mailbox, found not very good. decided to write a self-use.
The code is as follows
#!/usr/bin/python#-*-coding:utf-8-*-#输入这一条就可以在Python脚本里面使用汉语注释! This script can be copied directly, while True: #进入死循环 input = raw_input (' Your username: ') #交互式输入用户信息, enter the information of input; if input = = "Wendonggongzuoshi": #如果input等于wendonggongzuoshi则进入此循环 (if user input Wendonggongzuoshi) Password = raw_input (' Please input your pass: ') #交互式信息输入, enter password information; p = ' Wendonggongzuoshi ' #设置变量P赋值为wendonggongzuoshi while password! = P: #如果输入的password not equal to P (Wendonggongzuoshi), enter this into the loop password = raw_input (' Please input your pass again: ') #交互式信息输入, enter the password information; if password = = P: #如果password等于p (Wendonggongzuoshi), then enter this loop print ' Welcome to select system! ' #输出提示信息, while True: #进入循环; match = 0 #设 The set variable match equals 0; input = raw_input ("Please INPUT the name whom you want to search: ") #交互式信息输入, enter input information; while not Input.strip (): #判 Whether the broken input value is NULL, if input output is empty, enter the loop; input = raw_input ("Please input the name whom your WA NT to search: ") #交互式信息输入, enter input information; name_file = file ('/root/desktop/126/1.txt ') #设置变量name_file, file (' Search_name.txt ') is the call to a document named Search_name.txt while True: #进 line = Name_file.readline () #以行的形式, read the search_name.txt document information; If Len (line) = = 0: #当len (name_file.readline ()) is 0 o'clock, indicating that the file has been read, Len (Name_file.readline ()) for each The character length of the line, and the content of the empty line is \ n is also two characters. Len enters the loop 0 o'clock; break #执行到这里跳出循环; If input in line: #如果输入的input信息可以匹配到文件的某一行, enter the loop; print ' Match item:%s ' %line #输出匹配到的行信息; match = 1 #给变量match赋值为1 If match = = 0: #如果match等于0, then enter; print ' No match item found! ' #输出提示信息; Else:print "Sorry, user%s not found"%input #如果输入的用户不是wendonggongzuoshi, the output information does not have this user;
How to use
1. Enter username/password, Wendonggongzuoshi/wendonggongzuoshi
2. Test
3. Results come out
[Email protected] Taylor
4. Regarding the search speed, this search probably accounted for One-third, 4 million data of the farm's leaking database, basically two seconds search completed.
Python Search pig Farm someone's email password