我正在尝试从网络位置打开一个 .csv 文件并遇到以下错误..我有以下问题
1.如何在windows中打开网络位置
2.如何在windows和linux下打开同一个网络位置?
import csv
import datetime
from collections import deque
#from collections import maxlength
icount=9
now = datetime.datetime.now()
time =now.strftime("%m/%d/%Y")
#Keep appending date and count everytime this script is run
c = csv.writer(open("\\data\loc\\scripts\trend.csv", "ab"))
c.writerow([time, icount-1])
#Now read the recent 5 entries and print
#cr = csv.reader(open("trend.csv","rb"))
with open('trend.csv','rU') as fin:
reader=csv.reader(fin)
d=deque(reader,8)
for l in d:
print l[0]
print l[1]
错误:-
Traceback (most recent call last):
File "database.py", line 10, in <module>
c = csv.writer(open("\\data\loc\scripts\trend.csv", "ab"))
IOError: [Errno 2] No such file or directory: '\\data\loc\\scripts\trend.csv'