Please forgive my ignorance but forever I've been in the habit of building a library of useful subroutines which I call from an application I am building.
Recently the language has been python - a distinct departure from my experience. I've been unable to create a reasonable library. Here's the tree (an example)
mkfs a directory
subs a directory in which I keep my subroutines
__init__.py a file I got from DiveIntoPython
file1.py contains subroutine sub1
file2.py contains subroutine sub2
app.py needs to call sub1 and sub2
The only way I can make this work is
in __init__.py to import file1 and file 2 and
in app to import sub1 from subs and
when I want to call sub1, I have to subs.file1.sub1()
Surely there must be a better way. Perhaps a Pythonic way that has escaped me so far?
Help, please?
Purgatoryred, whose education is composed largely of assembly language where the forgoing would have been trivial.