Import module by name
| Parameters: |
|
|---|
Import attribute using string reference.
| Parameters: | name – String reference. |
|---|
Raises ImportError or AttributeError if module or attribute do not exist.
Example:
import_attribute('a.b.c.foo')
Checks if ImportError was raised because module does not exist or something inside it raised ImportError
| Parameters: | additional_depth – supply int of depth of your call if you’re not doing import on the same level of code - f.e., if you call function, which is doing import, you should pass 1 for single additional level of depth |
|---|