[Peter Hansen wrote]
> Richard Lewis wrote:
> > If you want to know where a particular directory is (on a Windows
> > 'drive') you could use:
> >
> > for drive_label in ["C", "D"]:
> > if "Program Files" in os.listdir(drive_label + ":/"): return
> > drive_label
>
> This would cause troubl
On XP at least you have the environment variable "ProgramFiles".
You can fetch the path it holds through os.environ
--
http://mail.python.org/mailman/listinfo/python-list
Richard Lewis wrote:
> If you want to know where a particular directory is (on a Windows
> 'drive') you could use:
>
> for drive_label in ["C", "D"]:
> if "Program Files" in os.listdir(drive_label + ":/"): return
> drive_label
This would cause trouble in at least two cases that I've seen.
On Tue, 14 Jun 2005 15:32:02 +0800, "Austin" <[EMAIL PROTECTED]>
said:
> 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 pat
[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