how to call os.path.join() on a list ...

greg greg at cosc.canterbury.ac.nz
Tue Feb 27 01:45:44 EST 2007


funkyj wrote:

> What is the python idiom for callling a function like os.path.join()
> that takes a variable number of arguments when you currently have the
> arguements in a list variable?

     os.path.join(*list_of_args)

This is preferable to joining it yourself with
os.path.sep, because it will do the right thing
for the platform, which might not be so simple
in all cases.

--
Greg



More information about the Python-list mailing list