On Mon, Jul 25, 2005 at 06:35:38AM -0400, Adam Hooper wrote: >On Mon, 2005-07-25 at 08:54 +0100, Magnus Therning wrote: >> Any advise on debugging Python extensions? > [.. snip since I'm only interested in debugging Python at the moment ..] > >However, using GDB to debug Python is rather involved. In my case I've >only ever needed it when debugging Pyphany itself. Within Python, all >I've ever done is prototype extensions using the Python Console, and >then just write that code into a .py for an extension. It's always Just >Worked. Maybe a few "print" statements within your Python code can help >you debug. Yes, using 'print' would go a long way, but I don't know where the result ends up. Do note that I'm using the standard Ubuntu Hoary package. Currently I'm raising exceptions where I'd like to put a 'print', when catching it I print the exception and the stack trace to a file which I 'tail -f'. It's a bit complicated and not very elegant... I do like the Python console, but I like IPython even better. However, I can't import the 'epiphany' module in IPython: In [2]: import epiphany --------------------------------------------------------------------------- exceptions.ImportError Traceback (most recent call last) /home/magnusth/<console> ImportError: /usr/lib/python2.4/site-packages/gtk-2.0/epiphany.so: undefined symbol: ephy_embed_single_set_offline_mode Is there some way to get this working? >Within your Python extension, I think you can't hold any global >variables pointing to EphyWindows or EphyTabs or the EphyShell; doing >so might stop Epiphany from shutting down properly. There are probably >exceptions (maybe keeping an EphyShell would work fine, I've never >tried), but you shouldn't do it. I'll keep that in mind for later. At the moment I'm only interacting with the bookmarks and nothing is kept in between calls to the one and only entry point (a menu entry). /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus therning org http://therning.org/magnus Software is not manufactured, it is something you write and publish. Keep Europe free from software patents, we do not want censorship by patent law on written works. To the consumer, cryptography is a shadowy protective entity -- something like Batman -- kind of menacing but on the side of justice, and endowed with mystic powers. -- Bruce Schneier, Secrets and Lies
Attachment:
pgpkAuyCpiOip.pgp
Description: PGP signature