Getting source code from interpreter-defined function

POYEN OP Olivier (DCL) Olivier.POYEN at clf-dexia.com
Fri Apr 11 13:49:29 CEST 2003


> Other solution: given any function, even defined in 
> interpreter, I can get function.func_code.co_code, which is 
> byte compiled code for this function. Perhaps I could use it 
> and decompile it. But how....? 
> 
> 

This one works with decomyler
>>>from decompyler import decompyle
>>>import sys
>>>def foo():print "coole"
>>>pythonVersion='2.2'
>>>decompyle(pythonVersion,foo,sys.sdtout)

print "coole"
#plus other stuff, code dependent

One way to go.
Is this the best way ?  
-------------- next part --------------
-----------------------------------------------------------------

Ce message est confidentiel ; son contenu ne represente en aucun

cas un engagement de la part de Dexia Credit Local ou de Dexia

CLF Banque. Toute publication, utilisation ou diffusion, meme

partielle, doit etre autorisee prealablement par l'emetteur. Si

vous n'etes pas destinataire de ce message, merci d'en avertir

immediatement l'expediteur.



This message is confidential ; its contents do not constitute a

commitment by Dexia Credit Local or Dexia CLF Banque. Any

unauthorised disclosure, use or dissemination, either whole or

partial, is prohibited. If you are not the intended recipient of

the message, please notify the sender immediately.

-----------------------------------------------------------------

Consultez notre site internet www.dexia-clf.fr

La cle d'une gestion optimisee du secteur public local

-----------------------------------------------------------------


More information about the Python-list mailing list