473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Advice on Python C modules

Hello all,

I think about rewriting one C++ library with Python wrappers (by sip) to
a pure Python module (because I just use it from Python).

I have to create custom types and inherit from those custom types.
Is it better to use pure C for that module, Pyrex or should I stay with
my current library (which has to be modified for some other reasons, too)?

thanks for your time

greets

Torsten

Jul 18 '05 #1
2 1158
Torsten Marek wrote:
I think about rewriting one C++ library with Python wrappers (by sip)
to a pure Python module (because I just use it from Python).

I have to create custom types and inherit from those custom types.
Is it better to use pure C for that module, Pyrex or should I stay
with my current library (which has to be modified for some other
reasons, too)?


It seems to me that you contradict yourself here.
Pure python is pure python without any c, c++, pyrex, sip, etc.
OTOH, if you still need compiled extension for some reason
(usualy only two excuses are good enough- speed and low-level
interface to something as hardware or 3rd party libraries)
why throw out good working code? It's not a good practice.

So if you don't *have to* use compiled extension you can ask how to achieve
desired results in pure python.

Mike


Jul 18 '05 #2
Mike Rovner schrieb:
Torsten Marek wrote:
I think about rewriting one C++ library with Python wrappers (by sip)
to a pure Python module (because I just use it from Python).

I have to create custom types and inherit from those custom types.
Is it better to use pure C for that module, Pyrex or should I stay
with my current library (which has to be modified for some other
reasons, too)?

It seems to me that you contradict yourself here.
Pure python is pure python without any c, c++, pyrex, sip, etc.
OTOH, if you still need compiled extension for some reason
(usualy only two excuses are good enough- speed and low-level
interface to something as hardware or 3rd party libraries)
why throw out good working code? It's not a good practice.

So if you don't *have to* use compiled extension you can ask how to achieve
desired results in pure python.

You're right, sorry. What I meant was compiled extension, because I need
access to 3rd party libs and I do not want to use their Python bindings
for speed reasons.

Torsten

Jul 18 '05 #3

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

Similar topics

10
by: Jeff Wagner | last post by:
I am in the process of learning Python (obsessively so). I've been through a few tutorials and read a Python book that was lent to me. I am now trying to put what I've learned to use by rewriting...
4
by: Paul Miller | last post by:
Some background first - we have some software that embeds a Python interpreter into a host application. Scripts are loaded dynamically and used. But we want to support the ability to edit scripts...
9
by: Rick Muller | last post by:
I have a problem that I would like to get some advice on from other Pythonistas. I currently manage a (soon to be) open source project for displaying molecular graphics for a variety of different...
1
by: David Bear | last post by:
I would like some advice on what crypto lib to use. I am writing a cgi app that will store sensative data in a backend postgresql server. I have some simple numeric data I would like to make as...
4
by: Socheat Sou | last post by:
After a brief, but informative, discussion on Freenode's #zope chatroom, I was advised to consult the gurus on c.l.p. I'm working for a small company who is in desperate need to rewrite it's...
9
by: TPJ | last post by:
First I have to admit that my English isn't good enough. I'm still studying and sometimes I just can't express what I want to express. A few weeks ago I've written 'Python Builder' - a bash...
3
by: seberino | last post by:
Anyone have any good advice to someone interested in learning about innards of Python implementation? e.g. What is best place to start? Where can I get a 10,000 ft. overview of general...
1
by: fhaibach | last post by:
I'm looking for advice on a stripped down Python for an SBC to run Numpy and Scipy. I have the following notes on the system We have code that requires recent versions of Numpy and Scipy. The...
1
by: Justin Johnson | last post by:
Hello, I'm trying to build Python 2.5.0 on AIX 5.3 using IBM's compiler (VisualAge C++ Professional / C for AIX Compiler, Version 6). I run configure and make, but makes fails with undefined...
9
by: Duncan Smith | last post by:
Hello, I find myself in the, for me, unusual (and at the moment unique) position of having to write a web application. I have quite a lot of existing Python code that will form part of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.