This is actually somewhat tricky, assuming we have structure like this:
├── bar
│ ├── __init__.py
│ └── some_bar.py
├── foo
│ ├── __init__.py
│ └── some_foo.py
├── __init__.py
└── something.py
the correct way to get objects from something.py in some_foo.py is by adding:
# foo/some_foo.py
from something import *some_module
and then running some_foo from top level directory as a module, with -m option like so:
python -m foo.some_foo
add some print statements to something.py to test it, if everything goes right you should see some output from something.py after running some_foo. Remember you need to run some_foo from top level, not from foo directory.
This is actually somewhat tricky, assuming we have structure like this:
├── bar
│ ├── __init__.py
│ └── some_bar.py
├── foo
│ ├── __init__.py
│ └── some_foo.py
├── __init__.py
└── something.py
the correct way to get objects from something.py in some_foo.py is by adding:
# foo/some_foo.py
from something import *
and then running some_foo from top level directory as a module, with -m option like so:
python -m foo.some_foo
add some print statements to something.py to test it, if everything goes right you should see some output from something.py after running some_foo. Remember you need to run some_foo from top level, not from foo directory.
This is actually somewhat tricky, assuming we have structure like this:
├── bar
│ ├── __init__.py
│ └── some_bar.py
├── foo
│ ├── __init__.py
│ └── some_foo.py
└── something.py
the correct way to get objects from something.py in some_foo.py is by adding:
# foo/some_foo.py
from something import some_module
and then running some_foo from top level directory as a module, with -m option like so:
python -m foo.some_foo
add some print statements to something.py to test it, if everything goes right you should see some output from something.py after running some_foo. Remember you need to run some_foo from top level, not from foo directory.
This is actually somewhat tricky, assuming we have structure like this:
├── bar
│ ├── __init__.py
│ └── some_bar.py
├── foo
│ ├── __init__.py
│ └── some_foo.py
├── __init__.py
└── something.py
the correct way to get objects from something.py in some_foo.py is by adding:
# foo/some_foo.py
from something import *
and then running some_foo from top level directory as a module, with -m option like so:
python -m foo.some_foo
add some print statements to something.py to test it, if everything goes right you should see some output from something.py after running some_foo. Remember you need to run some_foo from top level, not from foo directory.