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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章