尝试导入Excel电子表格时,系统出现以下错误:
import csv
import wikipedia
with open ('cities.csv', 'r') as csv_file:
csv_reader = csv.reader(csv_file)
with open('cities_out.csv', 'w') as new_file:
csv_writer = csv.writer(new_file)
for line in csv_reader:
coordinate = wikipedia.WikipediaPage(title = line).coordinates
csv_writer.writerow([line[0], coordinate[0], coordinate[1]])