On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote:

> What would be the best way, if any, to obtain
> the bytecode for a given loaded module?
> 
> I can get the source:
> import inspect
> import os
> src = inspect.getsource(os)
> 
> but there is no ispect.getbytecode()  ;-)
> 
> --Irmen

The inspect API documentation says that code objects have "co_code", which
is a string of raw compiled bytecode.

Hope that helps!

- -
Mark Nenadov
Python Byte Solutions
http://www.pythonbyte.com/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to