473,545 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ 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 1366
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.c om> ha scritto nel messaggio
news:11******** **************@ g47g2000cwa.goo glegroups.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
2386
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 about that ? Thanks in advance !!! Best, YY
14
3018
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
8267
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 2.4 installer for windows. Now I have problems to compile python extension that some packages
4
2943
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 inteface for a computation intensive application program which has a character-based user interface now. The original program was written in C. For the new...
0
1256
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, problems arise. I create new Empty Project, and add the 2 existing project. As for C++ project, most of the includes and coding is in .CPP file...
0
930
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 installed site packages can install links to their documentation in the Python Documentation Index. Are there already any thoughts or standards on how to...
158
6303
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 using a non open source tracker (called JIRA - never heard before of course) for Python itself. Does this smell "Bitkeeper fiasco" to anyone...
0
1114
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 = xyz.myclass() or from xyz import myclass #if you're lazy use ... import * x = myclass()
9
1556
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 declaring it to be Python 2.6, or maybe Python 2.7 without any approval of anyone at the PSF? Maybe their code is terrible, and not even compatible with the...
0
7499
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
7432
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
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7456
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
7786
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...
0
6022
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5359
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
5076
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1919
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 we have to send another system

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.