slightly harder n00b question

0 views
Skip to first unread message

Dr Mephesto

unread,
Sep 4, 2007, 2:23:20 PM9/4/07
to cherrypy-users
Hi Again,

So, I have finished my first cherrypy program (yay!), and now I have
to think about deploying it. But there are two things that have to be
sorted out first:

1) As part of the program needs to be very fast, it will have to be
rewritten in C/C++... Can anyone recommend a system to use? I am
currently considering the boost.python library.

2) How do you deploy a system with C++ dlls?

Thank in Advance!

David

Eugene Van den Bulke

unread,
Sep 4, 2007, 3:01:25 PM9/4/07
to cherryp...@googlegroups.com
+ ctypes to use a c/c++ dll
+ rewritting in pyrex instead of c/c++ and creatign a c-fast module
+ ...

all I can think of for now.

EuGeNe -- http://www.3kwa.com

Arnar Birgisson

unread,
Sep 4, 2007, 5:30:08 PM9/4/07
to cherryp...@googlegroups.com
On 9/4/07, Dr Mephesto <dnh...@googlemail.com> wrote:
> 1) As part of the program needs to be very fast, it will have to be
> rewritten in C/C++... Can anyone recommend a system to use? I am
> currently considering the boost.python library.

How complex is the interface the c-code must expose to Python? If it's
simple (a handful of functions with simple parameters/return values)
you can write a straight-up c-extension module fairly easily:
http://docs.python.org/ext/intro.html

Haven't used other methods myself so I might not be the best to judge.

> 2) How do you deploy a system with C++ dlls?

Depending on if you can compile on the target system, have a look at:
http://docs.python.org/dist/describing-extensions.html

Another way (which I use most of the time) are setuptools and Eggs:
http://peak.telecommunity.com/DevCenter/setuptools

You could have a look at how other people do it, for example MySQLdb
which includes a C-module (_mysql):
http://mysql-python.svn.sourceforge.net/viewvc/mysql-python/trunk/MySQLdb/

Arnar

Reply all
Reply to author
Forward
0 new messages