windows directory

Tim Golden tim.golden at viacom-outdoor.co.uk
Tue Jun 14 04:20:10 EDT 2005


[Austin]
| I would like to write a program which creates the folders in specific
| directory.
| For example, I want to create folder in Program Files. How do 
| I know which
| is in C:\ or D:\
| Is there any function to get the active path?

It's not quite clear what you mean. You seem to be asking three
possibly distinct questions:

1) How do I create folders in a particular directory.

A. Look at os.mkdir or os.makedirs


2) How do I know where the "Program Files" folder is?

A. Look at the shell module of the pywin32 extensions.
   Specifically, you're looking for the shell.SHGetPathFromIDList
   and shell.SHGetSpecialFolderLocation functions.


3) How do I know what the active path is?

A. Look at os.getcwd


I know I haven't been too detailed in my answers, but I didn't
want to spend lots of time explaining in case I'd actually
missed the point of the question.

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-list mailing list