我正在尝试在我的 Visual Studio 终端中打开 CSV 文件中的数据并接收:
''''
Traceback (most recent call last):
File "/home/jubal/ CrashCourse Python Notes/Chapter 16 CC/Downloading Date/csv
format/highs_lows.py", line 7, in <module>
with open(filename) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'sitka_weather_2018_full.csv'
''''
这是程序highs_lows.py,它与sitka_weather_2018_full.csv保存在同一文件夹中
''''
import csv
filename = 'sitka_weather_2018_full.csv'
with open(filename) as f:
reader = csv.reader(f)
header_row = next(reader)
highs = []
for row in reader:
highs.append(row[8])
print(highs)
''''
我的 latop 运行 linux mint 19.2 cinnamon,我也可以使用 jupyter notebook 运行这个程序,但是当我尝试转换为 python 程序并在 VS 代码终端中运行它时,就会出现这个问题。编程新手,所以任何帮助都会很棒。谢谢你的时间!