1

Without ever knowing anything about how the domain name, what is the best way to join several URL segments into a relative URL?

An example would be something like this:

>>> url_relative_join("/", "seg1", "", "seg2/", "seg3")
/seg1/seg2/seg3

Looks a lot like os.path.join... It there an equivalent library for URLs?

I've looked into urlparse, but it seems to work only with absolute URLs.

frnhr
  • 12,354
  • 9
  • 63
  • 90

0 Answers0