Python CGI 脚本:邮件发送者[重复]

问题描述 投票:0回答:1

执行 py 脚本时我总是遇到此错误

文件“mof.py”,第 25 行 对于dictionary.read().split('中的passwd '): ^ IndentationError:取消缩进与任何外部缩进级别不匹配

Python 脚本

try:
    sha1 = raw_input("\t\n\nsha1 Hash:")

 
 
    try:
        dictionary = open("dictionary.txt","r")
    except(IOError):
        print "dictionary.txt not found!"
    for passwd in dictionary.read().split('\n'):
        if hashlib.sha1(passwd).hexdigest() == sha1:
           
            print("\n\t[OK]"+sha1+" : "+passwd+"\n")
            raw_input("Decrytion Success; Press Enter To Exit")

    else:
            print "\n\tFailed; Password not found in dictionary"
 

    except (KeyboardInterrupt):
    print "\n\t[+] Terminated by user"

为什么?

python sha1
1个回答
-1
投票

else:
行需要进一步缩进。

© www.soinside.com 2019 - 2024. All rights reserved.