Re: for loop specifying the amount of vars

2008-11-24 Thread Steve Holden
Jules Stevenson wrote: > Hi, > > I have a list which contains a folder structure, for instance: > > dirs=['c:\', 'temp', 'foo', 'bar'] > Of course this should really be dirs=['c:\\', 'temp', 'foo', 'bar'] but we'll overlook your little syntax error ;-) > The length of the list can vary. I'd

RE: for loop specifying the amount of vars

2008-11-24 Thread Jules Stevenson
Sorry for the noise, I found the * unpack operator. Perfect for what I need. > > Hi, > > I have a list which contains a folder structure, for instance: > > dirs=['c:\', 'temp', 'foo', 'bar'] > > The length of the list can vary. I'd like to be able to construct a > os.path.join on the list, but

Re: for loop specifying the amount of vars

2008-11-24 Thread Tim Chase
I have a list which contains a folder structure, for instance: dirs=['c:\', 'temp', 'foo', 'bar'] The length of the list can vary. I'd like to be able to construct a os.path.join on the list, but as the list can vary in length I'm unsure how to do this neatly. Sounds like you want argument un

Re: for loop specifying the amount of vars

2008-11-24 Thread Benjamin Kaplan
On Mon, Nov 24, 2008 at 2:31 PM, Jules Stevenson <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list which contains a folder structure, for instance: > > dirs=['c:\', 'temp', 'foo', 'bar'] > > The length of the list can vary. I'd like to be able to construct a > os.path.join on the list, but as the