Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created September 20, 2017 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitsuhiko/3b51ffa6598bc3b744a6470bd42b9068 to your computer and use it in GitHub Desktop.
Save mitsuhiko/3b51ffa6598bc3b744a6470bd42b9068 to your computer and use it in GitHub Desktop.
>>> def join(doc, other):
... return os.path.join(os.path.dirname(doc), other)
...
>>> join('foo/index.html', 'other.html')
'foo/other.html'
>>> join('foo/', 'other.html')
'foo/other.html'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment