In Java, if some source code will be reused by others. We may create a utility class, if someone need this function, he/she can import this class and reuse this function. Do not need to reinvent the wheel.
Assume I have a simple Python code which named printLoop.py, the code is as bellows:
Supposed that many people may need this function to print the content of array. Therefore, you need to package this Python program as a module.
Step 1. Create a folder for my module which name printLoop
Step 2. Create a setup.py in printLoop folder
Step 3. Build distribution file
Step 4. Install the distribution file
1. Import printLoop module
2. Create a movie list
3. utilize printLoop.printMovies to print movie list