How to Resolve FileNotFoundError

Asked 2 years ago, Updated 2 years ago, 27 views

I'm a beginner who started studying python recently.
I read and write csv and xlsx files.
In the process, when I entered the code below in the book, a FileNotFoundError appeared.
The csv file exists because it is a self-made file for practice.

import csv
with open("book1.csv") as file:
    rows=csv.reader(file)
    For row in rows:
        print(row)

FileNotFoundError appears now.
Please let me know.

python

2022-09-30 21:43

1 Answers

I think you can put the csv file in the same folder where the code is stored.


2022-09-30 21:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.