0

Let's suppose I have the following file hierarchy:

program/
  ├─ main.py
  └─ util/
       └─ settings.py

main.py has the following import:

import .util.settings

Is there any way for code in settings.py to determine the path of the module that imported it (main.py)?

Nathan Osman
  • 71,149
  • 71
  • 256
  • 361

0 Answers0