FileNotFoundError: [Errno 2] No such file or directory [duplicate]

问题:

This question already has answers here : 这个问题在这里已经有了答案
Closed 3 years ago . 3年前关闭。

I am trying to open a CSV file but for some reason python cannot locate it.我正在尝试打开一个 CSV 文件,但由于某种原因 python 无法找到它。

Here is my code (it's just a simple code but I cannot solve the problem):这是我的代码(它只是一个简单的代码,但我无法解决问题):

import csv

with open('address.csv','r') as f:
    reader = csv.reader(f)
    for row in reader:
        print row

解决方案:

参考: https://stackoom.com/en/question/1VUlM
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章