Created
September 25, 2015 09:33
-
-
Save justinfay/d97069efda97e1d1720f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def make_url(base, *fragments): | |
| """ | |
| >>> make_url('http://example.com', '1', '2', '3.html') | |
| 'http://example.com/1/2/3.html' | |
| """ | |
| path = str(pathlib.Path(*fragments)) | |
| return urllib.parse.urljoin(base, path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment