[code.view]

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

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2008 Doug Hellmann All rights reserved.
     #
     """Combine path components to create a single path.
     """
     
     __version__ = "$Id$"
     #end_pymotw_header
     
     import os.path
     
     for parts in [ ('one', 'two', 'three'),
                    ('/', 'one', 'two', 'three'),
                    ('/one', '/two', '/three'),
                    ]:
         print parts, ':', os.path.join(*parts)
     

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

contact | logmethods.com