Pure Programmer
Blue Matrix


Cluster Map

Dependency Management

L1

This page is under construction. Please come back later.

It is often easier to write programs when you don't have to write all the code from scratch. There are a large number of code libraries available, both open source (free) and commercial (paid). Using code libraries written by the community or commercial developers give you a leg up in your coding efforts by making a large library of useful functions and classes available to your program. All we need to do is manage these dependencies and include them in our programs.

Since Python is an interpreted language, all you need to do to use pre-written code is to download the .py Python module file, put it in your project folder and then include it in your program. There are many built-in Python modules that you can use as well.

An easier way is to use the [[Package Installer for Python (pip)]] software that comes with Python to download and install libraries for you. The community maintains a large online library of modules that you can access using pip. Given the name of a module such as matplotlib, you can download it and install it in one step from the command line:

$ pip install matplotlib

You will want to download the [[Pure Programmer Python Utils Module]] which is needed by some examples and project. Simply put the Utils.py file in the same folder as your program. Then add a import statement to the beginning of your source file:

import math
import matplotlib
import Utils
Importing Python Modules

References