On 2008-05-05, Paul Scott <[EMAIL PROTECTED]> wrote: > Today, I needed to concatenate a bunch of directory paths and files > together based on user input to create file paths. I achieved this > through nested os.path.join()'s which I am unsure if this is a good > thing or not. > > example: > > if os.path.exists(os.path.join(basedir,picdir)) == True : > blah blah
That's not an example of nested os.path.join()'s. > Question is, is there a better way of doing this? I don't think so. > The above *works* but it looks kinda hackish... What about it do you think looks hackish? I supposed you could do this instead: path = os.path.join(basedir,picdir) if os.path.exists(path) == True : blah blah But I don't really see why that's any better. -- Grant Edwards grante Yow! Like I always say at -- nothing can beat visi.com the BRATWURST here in DUSSELDORF!! -- http://mail.python.org/mailman/listinfo/python-list