list comprehension to do os.path.split_all ?
stefaan.himpe at gmail.com
Thu Jul 28 22:32:17 CEST 2011
> [python 2.7] I have a (linux) pathname that I'd like to split
> completely into a list of components, e.g.:
> '/home/gyoung/hacks/pathhack/foo.py' --> ['home', 'gyoung',
> 'hacks', 'pathhack', 'foo.py']
Not sure what your exact requirements are, but the following seems to work:
pathname = '/home/gyoung/hacks/pathhack/foo.py'
Note that this would only work for absolute linux paths (i.e. starting
More information about the Python-list