Help me!

homework
python

#1
 elif passwordtry1 == password:
        with open("student details for programming project.txt", "a", newline='') as file1:
           file1Reader = csv.reader(file1)
           for row in file1Reader:
                print(row[0])
         file1.close()

for some reason this code doesnt work the error is :

Traceback (most recent call last):
File “N:\IT\year 11\prograMMING PROJECT.py”, line 62, in
for row in file1Reader:
io.UnsupportedOperation: not readable


#2

The error message has already stated that you haven’t give the permission to read the file but instead you opening it to write. Check the documentation.

Change the mode from 'a' to r.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.