Python Forum
io.UnsupportedOperation: not readable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
io.UnsupportedOperation: not readable
#1
i dont understand why i get this error,
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
Reply


Messages In This Thread
io.UnsupportedOperation: not readable - by navidmo - Oct-31-2019, 10:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  io.UnsupportedOperation: not readable RedSkeleton007 2 18,873 Nov-06-2023, 06:32 AM
Last Post: gpurdy
  io.UnsupportedOperation: fileno toml12953 3 1,788 Jun-15-2023, 08:48 PM
Last Post: toml12953
  How to make x-axis readable with matplotlib Mark17 7 4,004 Mar-01-2022, 04:30 PM
Last Post: DPaul
  Function global not readable by 'main' fmr300 1 1,380 Jan-16-2022, 01:18 AM
Last Post: deanhystad
  Display output in readable format and save hnkrish 1 2,664 Jul-19-2019, 09:29 AM
Last Post: Larz60+
  How to convert Python crawled Bing web page content to human readable? dalaludidu 4 3,462 Sep-02-2018, 04:15 PM
Last Post: dalaludidu
  Time Difference in Epoch Microseconds then convert to human readable firesh 4 11,678 Feb-27-2018, 09:08 AM
Last Post: firesh
  which code is more readable? Skaperen 5 5,741 Nov-14-2016, 02:37 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020