Accessing shared smb ubuntu in python scripts

I have a shared ubuntu drive on my network that I can access in nautilus using smb://servername/sharedfolder or smb:///sharedfolder.

I need to be able to access it python scripting from my ubuntu machine (8.10), but I can’t figure out how. I tried the obvious way (same address as nautilus), but wasn’t successful.

To play around, I tried printing the content of that folder with both:

for file in os.listdir(“smb://servername/sharedfolder”)
print file
Both give me “no file or directory” error on that path.

I’d really appreciate help on this – thanks.

Source: ubuntu

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.