Here is simple python code snippet to see the file location of a python package on command line:
$ python -c "import urllib2; print urllib2.__file__;" /usr/lib/python2.7/urllib2.pyc
.pyc extension represent the compiled python code. To see source file, replace .pyc with .py. So in above case /usr/lib/python2.7/urllib2.py is the main file.