Python is open source software availble for free from www.python.org. Version 2.7 is the current mature version that is widely supportly by other add-on modules, and is the one for which examples here are written. Python 3 is still under development and it currently lacks packages that are necessary for astronomy.
If you have Linux, then mostly likely you already have Python and you can stop here.
For other operating systems, consider using the academic version from Enthought Solutions if you meet their licensing terms for the free version. This version supplies Matplotlib, Numpy and Scipy which we will use. For more information about other options, see Python4Astronomers
Alternatively, the source of Python development has versions for MacOS and Windows of the base system that avoids the commercial (though free) route of other vendors:
Additional modules would have to be installed separately later.