执行我的py脚本时,我总是遇到此错误
文件" mof.py",第25行 for dictionary.read()。split(' \ n')中的passwd: ^ IndentationError:unindent与任何外部缩进级别都不匹配
Python脚本
尝试: sha1 = raw_input(" \ t \ n \ nsha1哈希:")
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"
为什么?
答案 0 :(得分:0)
else:
行需要进一步缩进。