471,310 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

Serializing Python compiled code.

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
Dec 9 '07 #1
1 1055
re***********@gmail.com wrote:
>
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?
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Dec 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

699 posts views Thread by mike420 | last post: by
28 posts views Thread by Maboroshi | last post: by
3 posts views Thread by codecraig | last post: by
2 posts views Thread by Tobias Zimmergren | last post: by
118 posts views Thread by 63q2o4i02 | last post: by
852 posts views Thread by Mark Tarver | last post: by
12 posts views Thread by Cagdas Ozgenc | last post: by
145 posts views Thread by Dave Parker | last post: by
53 posts views Thread by Vicent Giner | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.