- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
@I need to read the csv file from network share folder in Window by using Intel Edison board (Poky (Yocto Project Reference Distro) 1.7.3 piot005ai ttyMFD2), i686 GNU/Linux. I try to use the python code as below, but I get error.. I did change the '/' to '\', but same error resulted.
import csv
import os
x=os.listdir('////10.203.7.130//IoT//')
with open('////10.203.7.130//IoT//AlarmTrigger.csv', 'rb') as onOff:
reader = csv.reader(onOff)
for row in reader:
print row
onOff.close()
Error Message:
Traceback (most recent call last):
File "AlarmTrigger.py", line 4, in
x=os.listdir(''////10.203.7.130//IoT//')
OSError: [Errno 2] No such file or directory: ''////10.203.7.130//IoT//'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks Sergio, Finally I manage to done it by using WinSCP - Keep remote directory up to date feature.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I ran the same code and received the same error as you. Can you share more information about your project? You just want to read the csv file? Have you already tried with these examples? http://www.pythonforbeginners.com/systems-programming/using-the-csv-module-in-python/ http://www.pythonforbeginners.com/systems-programming/using-the-csv-module-in-python/ . Use one of these templates but adapt them to the csv file location. Also, can you confirm the file location? According to your error this is the cause of your error. Are you trying to export the file from that IP address?
-Sergio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks Sergio for your advice, I had try the example from the link you given. I can get the csv reading which store in local file, but when I try it for network share file, same error happened.
# !/usr/bin/env python
import csv
with open ('/tmp/AlarmTrigger.csv', 'rb') as onOff:
reader = csv.reader(onOff)
for row in reader:
print row
onOff.close()
The file is store in the share folder as below with ip address 10.203.7.130
The file is shared to everyone as below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I am able to ping the ip address, but cannot access the IoT directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Can you go to the folder where AlarmTrigger.csv is stored in your Windows machine? I believe the problem is because of the path you're using. From the path of your first picture, navigate all the way until you see the.csv file and post a screenshot.
-Sergio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks Sergio, Finally I manage to done it by using WinSCP - Keep remote directory up to date feature.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page