473,480 Members | 3,796 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Integrate C source in a Python project

Hi all.
I was wondering if it ispossible to integrate C source in a python project.

Best regards
Aug 26 '05 #1
5 1359
billiejoex wrote:
Hi all.
I was wondering if it ispossible to integrate C source in a python project.


There is ofcourse Python/C API
http://docs.python.org/api/api.html

But you will probably be easier off with Pyrex or Swig.

Good summary on when to use which
http://www.rexx.com/~dkuhlman/python...00000000000000

James

Aug 26 '05 #2
Than you James. I'll take a look as soon as possible.
It is possible do the contrary (integrates python source in a C project)?
"James" <fp****@gmail.com> ha scritto nel messaggio
news:11**********************@g47g2000cwa.googlegr oups.com...
billiejoex wrote:
Hi all.
I was wondering if it ispossible to integrate C source in a python
project.


There is ofcourse Python/C API
http://docs.python.org/api/api.html

But you will probably be easier off with Pyrex or Swig.

Good summary on when to use which
http://www.rexx.com/~dkuhlman/python...00000000000000

James

Aug 26 '05 #3
billiejoex wrote:
Hi all.
I was wondering if it ispossible to integrate C source in a python
project.

Best regards


Yes, of course. Have a look here:

http://docs.python.org/ext/ext.html

There are two nice tools for this:

SWIG
http://www.swig.org/Doc1.1/HTML/Python.html

SIP
http://www.river-bank.demon.co.uk/docs/sip/sipref.html

HTH
-----------------------------------
Alessandro Bottoni
Aug 26 '05 #4
>=20
Hi all.
I was wondering if it ispossible to integrate C source in a=20
python project.


Yes it is. Which tool you use depends on your requirements:

http://starship.python.net/crew/theller/ctypes/
ctypes allowes loading dlls/shared libs and calling functions=20
in that lib.

www.swig.org
is a wrapper for wrapping c/c++ to several languages as php, python, ...

www.boost.org
includes the boost pyhton library. this is my favorite for
wrapping c++ code.

Greetings, Uwe
Aug 26 '05 #5
"billiejoex" wrote_
Than you James. I'll take a look as soon as possible.
It is possible do the contrary (integrates python source in a C project)?


http://docs.python.org/ext/embedding.html

</F>

Aug 26 '05 #6

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

Similar topics

1
2383
by: Yi-Yu Chou | last post by:
Dear all, I need to integrate python, vtk and my own C++ object. Is it possible to do it by using python/C API ? Or there is a more efficient way to do it. Where can I find the examples taking...
14
3001
by: Dave Murray | last post by:
New to Python question, why does this fail? Thanks, Dave ---testcase.py--- import sys, urllib, htmllib def Checkit(URL): try: print "Opening", URL
188
8224
by: Ilias Lazaridis | last post by:
I'm a newcomer to python: - E01: The Java Failure - May Python Helps? http://groups-beta.google.com/group/comp.lang.python/msg/75f0c5c35374f553 - I've download (as suggested) the python...
4
2937
by: Alison | last post by:
Hello, All I am new to improving user interface. I have some questions for all the experts here who could help me out in this aspect. Now, I am in the early stage of developing a new user...
0
1246
by: Richard | last post by:
I have 2 projects that can run independently. One is built using Windows Forms Application (.NET) and the other is built on pure C++. Both project runs fine, but when I try to integrate them,...
0
925
by: Christoph Zwerschke | last post by:
I just thought it would be nice to have a standardized place to put the accompanying documentation for Python site packages, and something like a hook to register documentation so that all...
158
6277
by: Giovanni Bajo | last post by:
Hello, I just read this mail by Brett Cannon: http://mail.python.org/pipermail/python-dev/2006-October/069139.html where the "PSF infrastracture committee", after weeks of evaluation, recommends...
0
1104
by: Sells, Fred | last post by:
the short answer is a file is a module; therefore to 'include' access to 'myclass' in file xyz.py from another file called 'abc.py' you would put this in abc.py import xyz #note no '.py' x =...
9
1553
by: Dave | last post by:
With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and...
0
6905
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...
1
6736
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...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
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...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2994
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...
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.