By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,386 Members | 1,676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,386 IT Pros & Developers. It's quick & easy.

Extending and embedding Python

P: n/a
I want to write an application that embeds and extends (at least) the
Python and Perl interpreters. Now i want to find as much as possible
about the Python tools used for extending and embedding Python.
To be more specific: My app should:
1. Parse an input file.
2. Call a script in some scripting language, to generate an output file,
for example in C++.

For task 2 I need to call an embedded interpreter, and also provide call
backs from the scripting language to C++, in order to read global
information collected during parsing.

In order to correctly compile and link my Application, I need a OS
independent way to find compiler options and linker options necessary to
find header files and libraries. What methods should I use from
DistUtils for this purpose.
I also need to find some way to verify that linker options necessary for
embedding Perl is not incompatible with linking options for embedding
Python.

Stockholm July 11, 2005
Tommy Nordgren
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Tommy Nordgren wrote:
In order to correctly compile and link my Application, I need a OS
independent way to find compiler options and linker options necessary to
find header files and libraries. What methods should I use from
DistUtils for this purpose.


I don't think distutils supports linking applications that embed
Python, yet. It might be possible to write a distutils command for
that purpose, but I'd advise against that.

Instead, you should integrate the Python embedding into the build
process you alread have (e.g. make, shell scripts, whatever). You
can simplify the process by having a Python script compute all
the necessary parameters. You find the configuration-specific
information in distutils.sysconfig.

HTH,
Martin
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.