In Python, how do I perform the equivalent of the following
import http.client
but using a relative import:
from . import http.client
import .http.client
For a package http
in the current package? I want to then access the client
module through it's parent name, http.client
, as I would be able if I did the top level import.
I think that what you're looking for is this:
from ..http import client
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With