[python-win32] How to get Worgroup list?

Tim Golden tim.golden at viacom-outdoor.co.uk
Tue Jan 10 18:14:13 CET 2006


[Karlo Lozovina]
| 
| > http://groups.google.com/group/comp.lang.python/msg/d448ab26621ee8bf
| > http://groups.google.com/group/comp.lang.python/msg/2aa365a285899845
| > http://groups.google.com/group/comp.lang.python/msg/461ee641b16c2f96
| 
| Those three were really helpful, thank you.
| 
| But, I have further problems now. Now when I have list of 
| shares I want to get a list of directories and files within 
| a share, and for every file it's size.
| 
| I can get directory and file listing with os.listdir() (btw, how do I
| set apart directories and files?), but how do I get filesize for every
| file? Also, what to do when certain machine requires authorization?
How
| do I logon when required?

For dirs vs files, os.path.isfile / os.path.isdir
For file size os.path.getsize

Also, as someone else has suggested, look at os.walk as a quick
way of walking the file tree and distinguishing dirs & files in
one go.

If you need authentication, have a look at this thread (warning,
long URL):

http://groups.google.com/group/comp.lang.python/browse_frm/thread/c3714d
e4595921ca/08f14ac7fe712e43?lnk=st&q=&rnum=5#08f14ac7fe712e43

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the Python-win32 mailing list