执行 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"
为什么?
else:
行需要进一步缩进。