How to Print the File Location of a Python Module

The are times were you may need to print the location of a python module. There are a number of ways to achieve this. However the most simplistic method  have found is to use 'inspect'.

Below shows you an a example,

>>> import inspect
>>> import urllib2
>>> print inspect.getfile(urllib2)

Tags: Python