En Thu, 27 Mar 2008 00:34:20 -0300, Astan Chee <[EMAIL PROTECTED]> escribió:

> I have a file on another machine on the local network (my machine and
> local machines are on windows) and I want to copy it locally. Now the
> machine requires authentication and when I try to do a
> import shutil
> shutil.copy(r'\\remotemachine\c$\temp\filename',r'C:\folder\test.txt')
> and it gives me a IOError: [Errno 13] Permission denied: error, which I
> expect. How do I provide authentication to copy this file?

Probably there are other ways, but the "net use" command looks easy  
enough. Execute "net help use | more" in a console to see the right syntax.
Use the subprocess module to run the command from inside Python.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to