[code.view]

[top] / python / PyMOTW / ospath / ospath_expandvars.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2008 Doug Hellmann All rights reserved.
     #
     """Expand shell variables in filenames.
     """
     
     __version__ = "$Id$"
     #end_pymotw_header
     
     import os.path
     import os
     
     os.environ['MYVAR'] = 'VALUE'
     
     print os.path.expandvars('/path/to/$MYVAR')
     

[top] / python / PyMOTW / ospath / ospath_expandvars.py

contact | logmethods.com