views:

65

answers:

3

I'm attempting to add a video extension to the Python Markdown-2.0.3-py2.7.egg

Things aren't working, so I want to use pdb debugger to see what's going on.

I can't seem to find the source code to insert pdb.

The egg is located here:

/usr/local/lib/python2.7/site-packages/Markdown-2.0.3-py2.7.egg

Using iPython, I can view the Python source code of the Markdown module and it's path:

/usr/local/lib/python2.7/site-packages/Markdown-2.0.3-py2.7.egg/markdown/__init__.py

But I can't navigate to that file, nor can open it in a Text Editor.

I'm guessing the source code I'm viewing may be generated from the compiled egg. However, it seems there must be some way of accessing the code.

+2  A: 

A .egg file is a zipfile -- so, typing at a command prompt or shell prompt unzip -l /usr/local/lib/python2.7/site-packages/Markdown-2.0.3-py2.7.egg should tell you about its contents, for example (if you have unzip on your shell or command's $PATH, of course).

Alex Martelli
A: 

An .egg file is a simple ZIP archive, you can extract the files using any ZIP-enabled application if you want. That being said, you can install an .egg into a folder for development by passing the develop option to setup.py. This will make setuptools use the sources in the specified folder and just link to them by a file in your package path.

Jim Brissom
A: 

You could reinstall the egg as a directory. Look in the comments of this answer

knitti