Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Import libraries from ROOT directory in python

I have the following structure of my program:

MainDir
├── __init__.py
├── main.py
├── Routine.py
└── Folder1
 ├── __init__.py
 └──function.py

I know that I can import a function from folder 1 to my main.py program writing this statement:

from Folder1.function import foo

But, I am looking for a way to do so in the other direction. How could I import a function defined in Routine.py to function.py?

Answer*

Draft saved
Draft discarded
Cancel

lang-py

AltStyle によって変換されたページ (->オリジナル) /