How can I open a Python shell at a network path in Windows?
How can I open a Python interpreter at a specific network path in Windows?
In the Explorer address bar the pa开发者_高级运维th is in UNC form: \\myhost\myshare\...
.
I can't work out how to change to this directory from the Windows command line, nor in what format I could pass it as an argument to os.chdir
.
I'm running Python 2.5 on Windows XP. IDLE is installed.
Thanks!
Well, I'm going to ask it anyway because it has bit me before but have you tried something like this?
path = r'\\myhost\myshare\some_file.dat'
The r
being the important bit here.See this post as well.
You need to map it as a drive.
hope this helps : http://www.blog.pythonlibrary.org/2008/05/12/mapping-drives-on-windows/
EDIT :
for root, dirs, files in os.walk(r'\\myhost\myshare\'):
print root, dirs
精彩评论