This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gpolo
Recipients exarkun, gpolo
Date 2008-10-28.17:43:54
SpamBayes Score 9.112105e-06
Marked as misclassified No
Message-id <1225215835.44.0.0766994804455.issue4223@psf.upfronthosting.co.za>
In-reply-to
Content
Well anyway, some sample code:

import zipfile

z = zipfile.ZipFile('aaa.zip', mode='w')
z.writestr('aa.py', 'def x(): print "hi there"\n\ndef y(): print "hi"')
z.close()


and then:


import sys
import inspect

sys.path.append('aaa.zip')
import aa

inspect.getsource(aa.x)
inspect.getsource(aa.y)


Doesn't that work for you ?
History
Date User Action Args
2008-10-28 17:43:55gpolosetrecipients: + gpolo, exarkun
2008-10-28 17:43:55gpolosetmessageid: <1225215835.44.0.0766994804455.issue4223@psf.upfronthosting.co.za>
2008-10-28 17:43:54gpololinkissue4223 messages
2008-10-28 17:43:54gpolocreate