Oct-31-2019, 10:26 PM
i dont understand why i get this error,
thnks for your helping
thnks for your helping
import hashlib import csv input_file_name = 'c:/users/shervin/documents/pass.csv' output_file_name = 'c:/users/shervin/documents/pass1.csv' def hash_password_hack(input_file_name, output_file_name): source = [] source_names = [] with open(input_file_name,'r', newline='') as f, open(output_file_name, 'w',newline='') as f: reader = csv.reader(f) for row in reader: source.append(row[1]) source_names.append(row[0]) pass_hash = {} for i in range(1000, 10000): i_st = str(i) i_st = hashlib.sha256(i_st.encode("utf-8")) hashed = i_st.hexdigest() pass_hash[hashed] = i for h in range(0, len(source)): if source[h] in pass_hash: csv_output.writerow(source_names[h], pass_hash[source[h]]) hash_password_hack(input_file_name, output_file_name)
Output:Traceback (most recent call last):
File "C:/Users/shervin/Downloads/15233519514032056 (1).py", line 26, in <module>
hash_password_hack(input_file_name, output_file_name)
File "C:/Users/shervin/Downloads/15233519514032056 (1).py", line 11, in hash_password_hack
for row in reader:
io.UnsupportedOperation: not readable