Hi, > Don't think it will do much good. I need to get them from a file and > extract the last folder in the path. For example: > if I get "c:\dos\util" > I want to extract the string "\util"
Still, os.path is your friend: import os filepath = r'C:\dos\util' base, last = os.path.split(filepath) print base # 'C:\dos' print last # 'util' print os.sep+last # '\util' Don't forget to read > > http://docs.python.org/lib/module-os.path.html for some more info! Regards, Mc! -- http://mail.python.org/mailman/listinfo/python-list