On Jun 11, 1:58 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > >In xp when I try os.path.getmtime("%userprofile/dir/file%") Python > >bites back with "cannot find the path specified" Since my script has > >to run on machines where the username is unspecified I need a fix. > > For the record, the %PERCENT% syntax for looking up an environment variable > is just a feature of the XP command shell. It has no meaning to any other > part of Windows. > > os.environ is the right answer. > -- > Tim Roberts, [EMAIL PROTECTED] > Providenza & Boekelheide, Inc.
You can use it at the Run command or in Explorer too. If I type %username% in either place, it opens the following on my XP machine: C: \Documents and Settings\Mike Mike -- http://mail.python.org/mailman/listinfo/python-list