![](/img/trans.png)
[英]Pycharm. 'Process finished with exit code 0' . No output in print()
[英]no output/pwd print - zip cracker Process finished with exit code 0
import zipfile
import itertools
import string
from threading import Thread
def crack(zip, pwd):
try:
zip.extractall(pwd=str.encode(pwd))
print("Success: Password is " + pwd)
except:
pass
zipFile = zipfile.ZipFile("/Users/Yamakasi/Desktop/PY/Mat1.zip")
myLetters = string.ascii_letters + string.digits + string.punctuation
for i in range(1, 1):
for j in map("".join, itertools.product(myLetters, repeat=i)):
t = Thread(target=crack, args=(zipFile, j))
t.start()
#Hey @ll,進程以退出代碼 0 結束,但在 zip 破解程序上沒有 output? 問候並感謝您的幫助!
問題在於您的外部for
循環。 它根本不運行。
range(i, j)
從i
運行到j-1
,因此range(1, 1)
將從1
運行到0
,這意味着根本不運行。
for i in range(1, 1):
print("hi")
上面的代碼不print
任何東西,因為for
循環沒有輸入一次。 如果你想運行一次for
循環,你應該使用:
for i in range(1, 2):
print("hi")
Output:
hi
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.