[Tutor] url parsing

Daniele d.conca at gmail.com
Sun Feb 15 15:04:17 CET 2009


use this if you want to take a hammer to crack a nut :D

import os
url = 'http://this/is/my/url/to/parse'
os.path.basename(url) #gives "parse"
os.path.dirname(url) #gives 'http://this/is/my/url/to'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090215/b5077d76/attachment.htm>


More information about the Tutor mailing list