473,563 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Embedding python in C

Hi,

Is there a program out there that would generate the C code to instantiate
objects and call them:

ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?

I seem to recall a _yes_ to that but I got a memory overflow :-)

Thanks,

Philippe
Jul 19 '05 #1
4 1312
Just to make sure i'm clear as I've been told about swig and pyrex: I don't
want to eventually have a python script call C modules, but rather a main.c
make calls to python functionnalitie s.

I did add newbie in the title :-)

Regards,

Philippe

Philippe C. Martin wrote:
Hi,

Is there a program out there that would generate the C code to instantiate
objects and call them:

ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?

I seem to recall a _yes_ to that but I got a memory overflow :-)

Thanks,

Philippe


Jul 19 '05 #2
Sorry, it is still not clear when I reread it:

1) I have a bunch of Python working modules
2) I need to compile "something" so external C applications can access 1)

Thanks,

Philippe

Philippe C. Martin wrote:
Just to make sure i'm clear as I've been told about swig and pyrex: I
don't want to eventually have a python script call C modules, but rather a
main.c make calls to python functionnalitie s.

I did add newbie in the title :-)

Regards,

Philippe

Philippe C. Martin wrote:
Hi,

Is there a program out there that would generate the C code to
instantiate objects and call them:

ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?

I seem to recall a _yes_ to that but I got a memory overflow :-)

Thanks,

Philippe


Jul 19 '05 #3
pyrex can be used for embedding too.
http://www.freenet.org.nz/python/embeddingpyrex/

On 6/28/05, Philippe C. Martin <ph************ *@sbcglobal.net > wrote:
Actually maybe not ... looking at the doc:

I have modules already coded in Python, and I need a C wrapper so C
applications may link with it.

Regards,

Philippe



On Tuesday 28 June 2005 04:53 pm, Philippe C. Martin wrote:
Sounds like it, thanks.

Philippe

On Tuesday 28 June 2005 09:10 pm, Chris Lambacher wrote:
Pyrex might be what you are looking for:
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/

-Chris

On 6/28/05, Philippe C. Martin <ph******@phili ppecmartin.com> wrote:
> Hi,
>
> Is there a program out there that would generate the C code to
> instantiate objects and call them:
>
> ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?
>
> I seem to recall a _yes_ to that but I got a memory overflow :-)
>
> Thanks,
>
> Philippe
> --
> http://mail.python.org/mailman/listinfo/python-list


--
*************** *************** *******
Philippe C. Martin
SnakeCard, LLC
www.snakecard.com
+1 405 694 8098
*************** *************** *******

--
Christopher Lambacher
la******@comput er.org
Jul 19 '05 #4
Thanks, I cannot get the demo to compile, but I joined their list.

Thanks

Philippe

Chris Lambacher wrote:
pyrex can be used for embedding too.
http://www.freenet.org.nz/python/embeddingpyrex/

On 6/28/05, Philippe C. Martin <ph************ *@sbcglobal.net > wrote:
Actually maybe not ... looking at the doc:

I have modules already coded in Python, and I need a C wrapper so C
applications may link with it.

Regards,

Philippe

On Tuesday 28 June 2005 04:53 pm, Philippe C. Martin wrote:
> Sounds like it, thanks.
>
> Philippe
>
> On Tuesday 28 June 2005 09:10 pm, Chris Lambacher wrote:
> > Pyrex might be what you are looking for:
> > http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
> >
> > -Chris
> >
> > On 6/28/05, Philippe C. Martin <ph******@phili ppecmartin.com> wrote:
> > > Hi,
> > >
> > > Is there a program out there that would generate the C code to
> > > instantiate objects and call them:
> > >
> > > ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?
> > >
> > > I seem to recall a _yes_ to that but I got a memory overflow :-)
> > >
> > > Thanks,
> > >
> > > Philippe
> > > --
> > > http://mail.python.org/mailman/listinfo/python-list


--
*************** *************** *******
Philippe C. Martin
SnakeCard, LLC
www.snakecard.com
+1 405 694 8098
*************** *************** *******



Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2504
by: jordi | last post by:
Hi, I'm starting to use Python embedded in a C program. I'm using Python to execute several scripts using as a variables information retrieved for several multithread "agents" written in C. The method is: 1- Create a thread for each agent (I use a pool thread, every agent run in a different thread) 2- Precompile a different script for...
0
1835
by: Atul Kshirsagar | last post by:
I am embedding python in my C++ application. I am using Python *2.3.2* with a C++ extention DLL in multi-threaded environment. I am using SWIG-1.3.19 to generate C++ to Python interface. Now to explain it in details, 1. Python initialization and finalization is done in the *main* thread. 2. For each new thread I create a separate...
23
2942
by: Robey Holderith | last post by:
Anyone know a good way to embed python within python? Now before you tell me that's silly, let me explain what I'd like to do. I'd like to allow user-defined scriptable objects. I'd like to give them access to modify pieces of my classes. I'd like to disallow access to pretty much the rest of the modules.
4
2765
by: Alicia Haumann | last post by:
I accidentally sent this to webmaster@python.org, so this could be a duplicate if "webmaster" forwards it to this list. :{ Hi, there. Thanks for any help that can be offered. I've been working with Python for a year or more now, but only doing simple extending in C/C++. I'm now attempting some embedding and several questions have come...
1
537
by: Martin | last post by:
Greetings, I am new to python and wish to embed python in an 3D graphics application to provide application automation. The high level goal is to be able to drive my app from a script for batch job like behavior rather than via the GUI (ie. I would like to run a script and see those changes reflected in the GUI as if the user had clicked...
2
2855
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an embedded scripting language (a very limited one). I would like to rip it out and replace it with Python. I am thinking that this would be relatively...
1
1900
by: amit | last post by:
Hello, I am currently studying how to embedd python. I am developing a graphical C++ application. My goal is to embedd python script that will control some kind of animation. I have some questions about python embedding: 1) Is there a good text book or other resource on embedding/extending? (I find it hard to learn only by the tutorial...
1
1816
by: Tommy Nordgren | last post by:
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...
6
2987
by: Qun Cao | last post by:
Hi Everyone, I am a beginner on cross language development. My problem at hand is to build a python interface for a C++ application built on top of a 3D game engine. The purpose of this python interface is providing a convenient scripting toolkit for the application. One example is that a user can write a python script like: player =...
0
2098
by: Tim Spens | last post by:
--- On Fri, 6/27/08, Tim Spens <t_spens@yahoo.comwrote: I think I know where the problem is but I'm unsure how to fix it. When I call Register_Handler(...) from python via callback.setHandler1(callback1) this only seems to affect pythons ability to trigger an "event" in c. PyObject *Handler is always NULL even after I call...
0
7659
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.