os.path.sep.join
1
2
>>> os.path.join("foobar", "/foo/baz/", "whatever")
'/foo/baz/whatever'
Noman Nosher
1
2
>>> os.path.join("foobar", "/foo/baz/", "whatever")
'/foo/baz/whatever'
1
2
3
4
>>> type(os.sep)
<class 'str'>
>>> os.sep.join(["foobar", "/foo/baz/", "whatever"])
'foobar//foo/baz//whatever'