There is a lot of material on internet about Python modules, but it takes time to conclude what the simplest way is. I spend last few days doing some research and trying out things until I arrived at something simple and what I believe could be used at the enterprise level.
I am in the process of learning this and I decided to document it for others with very simple examples that you can download and try yourself.
Click HERE to download the code from my Google Drive.
Below are the screenshots of the code structure. You will see that there are two modules that are bundled under one module_util:
- util_general
- util_math
To make the example more realistic, the util_math module using code from util_general module.
The code in main.py shows you you can properly import the modules and use the functions from these modules.
NOTE:
My next post will be about making some additions in this code to make this code distributed in the form of Python eggs.
Then the post after that will about using this Python egg in a different application as a black box.
Almir M.
No comments:
Post a Comment