Serializing Python compiled code.

R

renjipanicker

Hi everyone,

In a C++ application having a Python interpreter embedded, is it
possible to compile a small Python snippet into object code and
serialize the compiled object code to, for example, a database? I am
exploring the possibility of writing a data driven application, where
small-sized object code can be read from a database and executed.
Keeping aside all other considerations such as security, etc for a
moment, is this feasible?

Please do reply.

Thanks,
-/renji
 
Joined
Dec 5, 2007
Messages
4
Reaction score
0
You might want to look into ZODB, the standalone database engine which comes with Zope.
 
T

Tim Roberts

In a C++ application having a Python interpreter embedded, is it
possible to compile a small Python snippet into object code and
serialize the compiled object code to, for example, a database? I am
exploring the possibility of writing a data driven application, where
small-sized object code can be read from a database and executed.
Keeping aside all other considerations such as security, etc for a
moment, is this feasible?

The biggest problem, in my view, is that the compiled object code won't
work with any other version of Python, or with versions where the compiler
was built with other options, or possibly even on other processors with the
same version. The nice thing about a database server is that you can use
it from different computers without worrying about versions or processors.

Compilation is not that expensive. Why not just store the raw code
snippets?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top