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

2007-02-26 Thread greg
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 wi

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

2007-02-26 Thread Ben Finney
"funkyj" <[EMAIL PROTECTED]> writes: > I want to call os.path.join() on a list instead of a variable list of > arguments. I.e. > > [...] > >>> import os > >>> import string > >>> p = os.environ['PWD'] > >>> p > '/tmp/a/b/c/d' > >>> os.path.join(string.split(p, os.sep))

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

2007-02-26 Thread funkyj
On Feb 26, 8:03 pm, "funkyj" <[EMAIL PROTECTED]> wrote: > I want to call os.path.join() on a list instead of a variable list of > arguments. I.e. > > [scr-misc] (186:0)$ python > iPython 2.4 (#2, Feb 18 2005, 16:39:27) > [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 > Type "help", "c