imp.load_module from a string

Chris Withers chrisw at nipltd.com
Fri Jul 7 09:07:35 EDT 2000


Hi,

I am trying to a load a .pyc which has been pickled, sent over a TCP/IP
connection and then unpickled into a string.

imp.load_module seems perfect, however, when I call it with:

imp.load_module(moduleName,
                StringIO.StringIO(modulePYC),
                moduleName+'<remote>',
                (".pyc","rb",imp.PY_COMPILED))

I get:

ValueError: load_module arg#2 should be a file or None

Anyone know how I should be doing this?

cheers,

Chris


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list