How to open a remote file using python.

Chris Rebert clp2 at
Sun Feb 22 23:21:43 EST 2009

On Sun, Feb 22, 2009 at 8:13 PM, venutaurus539 at
<venutaurus539 at> wrote:
> Hello all,
>           I am writing an application where I need to open a shared
> file on a remote machine using python script. I tried using the
> following function:
> f ="\\remote_machine\\folder1\\file1.doc")
>         I also tried using
> class urllib.FancyURLopener(...)
>         but didn't work. Can some one help me in this regard.

That function and class are be for retrieving materials over the web
(typically HTTP/FTP); however, your path suggests you're trying to
access a file over a local Windows network, so those aren't
appropriate. The regular open() function would have a better chance of
working for this. Have you tried it?


Follow the path of the Iguana...

More information about the Python-list mailing list