Hello together,
i just finished my first own package but facing a problem when importing and executing things from outside:
I made a very minimal example as demonstration:
Folder "mymodule" contains:
On the same level as mymodule is :
Unfortunately i get the error message: "no module named 'constant' " which confuses me since i can import constant in function.py properly.
Question: Why is that? ( Maybe this code should that never be necessary - let me know anything you have in mind :)
Thank you very much,
Bock
PS: how can i make a "tab" in the python brackets of the thread editor?
i just finished my first own package but facing a problem when importing and executing things from outside:
I made a very minimal example as demonstration:
Folder "mymodule" contains:
1 2 3 4 5 6 7 8 9 |
#__init__.py # empty #constants.py my_const = 42 #function.py def my_func(): print (my_const) |
1 2 3 |
# test.py from mymodule.function import my_func my_func() |
Question: Why is that? ( Maybe this code should that never be necessary - let me know anything you have in mind :)
Thank you very much,
Bock
PS: how can i make a "tab" in the python brackets of the thread editor?