On Thu, Jan 13, 2011 at 1:51 PM, Christian Witts <cwi...@compuscan.co.za> wrote:
> First split your path into segments, then iterate over those segments and
> build your new list (item one being the current segment, and part two a
> joined string of previous segments).
>

thanks Christian,

path = 
'Audio/site-packages/pygame/examples/macosx/aliens_app_example/English.lproj'
path=urllib.url2pathname(path)
print '\n',path

pathlist=[]
dir=''
for item in path.split("\\"):
    dir=os.path.join(dir,item)
    a=[item,dir]
    pathlist.append(a)

print pathlist
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to