1import os
2from urllib.parse import urlparse
3
4url = "http://photographs.500px.com/kyle/09-09-201315-47-571378756077.jpg"
5a = urlparse(url)
6print(a.path) # Output: /kyle/09-09-201315-47-571378756077.jpg
7print(os.path.basename(a.path)) # Output: 09-09-201315-47-571378756077.jpg
8