0

I've written a few tools to run inside a python environment, specifically Autodesk Maya (A 3d animation package software). Generally i like to build my tools with the same folder structure as scene below.

I was wondring, how would i properly write my 'import' statements in the utils/general.py file if i wanted it to import views/objects.py without conflicting and trying to import from the wrong tool?

ToolA
    - views/
        objects.py
    - utils/
        general.py
    main.py


ToolB
    - views/
        objects.py
    - utils/
        general.py
    main.py
JokerMartini
  • 5,219
  • 4
  • 55
  • 162

1 Answers1

1

You might want to look into the package/module concepts for Python. Specifically, adding __init__.py files may help your imports.

See this answer for somewhere to get started: https://stackoverflow.com/a/4116384/3856731

Eric Canton
  • 275
  • 1
  • 9