l******9 发帖数: 579 | 1 【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: error of opening a file located in a remote server from pyton
发信站: BBS 未名空间站 (Sun Jul 27 19:03:52 2014, 美东)
I need to access read a csv file located in a server from python 3.2 on win7.
The file name is
csv_file =
file_loc = '\serverName.myCompanyName.com\mypath\Files\myfile.csv'
with open(file_loc , 'r') as csv_file # error !!!
csv_reader = csv.reader(csv_file, delimiter=',')
error:
IOError: [Errno 2] No such file or directory: '\serverName.myCompanyName
.com\mypath\Files\myfile.csv'
But, I can access the folder and open the file from win 7 .
Thanks | n****e 发帖数: 629 | 2 try urllib2 module
win7.
【在 l******9 的大作中提到】 : 【 以下文字转载自 JobHunting 讨论区 】 : 发信人: light009 (light009), 信区: JobHunting : 标 题: error of opening a file located in a remote server from pyton : 发信站: BBS 未名空间站 (Sun Jul 27 19:03:52 2014, 美东) : I need to access read a csv file located in a server from python 3.2 on win7. : The file name is : csv_file = : file_loc = '\serverName.myCompanyName.com\mypath\Files\myfile.csv' : with open(file_loc , 'r') as csv_file # error !!! : csv_reader = csv.reader(csv_file, delimiter=',')
|
|