Need Help with an error in my Code /u/Commander_Ezra Python Education

Hello Everyone!

So i am making a pretty simple menu driven program for a project of my Comp Sci Class of Junior Year. I know it’s really easy and simple and isn’t a good project, I’m just making this as a demonstration, I’ll make a better one after this.

But all things aside. Here’s the code:

(I couldn’t write the code here without it removing the indentation, So i am posting a Google Drive Link for a .py file. Please reference the code from there)

Google Drive Link: https://drive.google.com/file/d/1aK9ekfZ9MIcdiWtvv8J48dL6lnD7OEut/view?usp=drive_link

This is the Error message i am facing:

Traceback (most recent call last):

File “C:UsersAdminOneDriveDesktopTest.py”, line 133, in <module>

writer.writerow(row)

File “C:Program FilesPython312Libcsv.py”, line 164, in writerow

return self.writer.writerow(self._dict_to_list(rowdict))

ValueError: I/O operation on closed file.

The error is occuring in the elif statement of the 7th option, I tried using Gemini to resolve this but to no avail.

Python Version: 3.12.4

Kindly provide suggestions/help

Also if you guys can suggest some improvements for the code than it would be a help

Thanks!

submitted by /u/Commander_Ezra
[link] [comments]

​r/learnpython Hello Everyone! So i am making a pretty simple menu driven program for a project of my Comp Sci Class of Junior Year. I know it’s really easy and simple and isn’t a good project, I’m just making this as a demonstration, I’ll make a better one after this. But all things aside. Here’s the code: (I couldn’t write the code here without it removing the indentation, So i am posting a Google Drive Link for a .py file. Please reference the code from there) Google Drive Link: https://drive.google.com/file/d/1aK9ekfZ9MIcdiWtvv8J48dL6lnD7OEut/view?usp=drive_link This is the Error message i am facing: Traceback (most recent call last): File “C:UsersAdminOneDriveDesktopTest.py”, line 133, in <module> writer.writerow(row) File “C:Program FilesPython312Libcsv.py”, line 164, in writerow return self.writer.writerow(self._dict_to_list(rowdict)) ValueError: I/O operation on closed file. The error is occuring in the elif statement of the 7th option, I tried using Gemini to resolve this but to no avail. Python Version: 3.12.4 Kindly provide suggestions/help Also if you guys can suggest some improvements for the code than it would be a help Thanks! submitted by /u/Commander_Ezra [link] [comments] 

Hello Everyone!

So i am making a pretty simple menu driven program for a project of my Comp Sci Class of Junior Year. I know it’s really easy and simple and isn’t a good project, I’m just making this as a demonstration, I’ll make a better one after this.

But all things aside. Here’s the code:

(I couldn’t write the code here without it removing the indentation, So i am posting a Google Drive Link for a .py file. Please reference the code from there)

Google Drive Link: https://drive.google.com/file/d/1aK9ekfZ9MIcdiWtvv8J48dL6lnD7OEut/view?usp=drive_link

This is the Error message i am facing:

Traceback (most recent call last):

File “C:UsersAdminOneDriveDesktopTest.py”, line 133, in <module>

writer.writerow(row)

File “C:Program FilesPython312Libcsv.py”, line 164, in writerow

return self.writer.writerow(self._dict_to_list(rowdict))

ValueError: I/O operation on closed file.

The error is occuring in the elif statement of the 7th option, I tried using Gemini to resolve this but to no avail.

Python Version: 3.12.4

Kindly provide suggestions/help

Also if you guys can suggest some improvements for the code than it would be a help

Thanks!

submitted by /u/Commander_Ezra
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *