[Zope] Zope interfacing with C

Tino Wildenhain tino@wildenhain.de
Fri, 27 Apr 2001 16:57:18 +0200


Hi lee,

first of all, zope consists of small parts written in C and large
parts written in python. Python in turn is also written in C and
there are interfaces (see http://www.python.org for documentation
how to extend python in C)

However, your solution depends on how long does it take to make
calculations on the data. Since database generally dont "send" dates
explicitely to applications - applications have to "ask" databases
for data, you need to set up a mechanism to "start" calculations
on user request and give the output back to the user later.
If the application running time is short compared to a typical
web request (several seconds to max 30 seconds), you can tie the
application directly to the server. This can be done with
the "system" command in an external method, if zope is running
at the same machine as the executable. You can also make a
http-request or generic socket open/send data/wait for answer/close
with python in external methods to interact with an application on
a different machine.

If the running time is far more then 30 secs, you should consider
to make a job-batching. Something like putting jobs in a database
accessible by the application and if the application is ready with one
job it can do the next, putting the results in the database
again, where they can be accessed by the user in subsequent page
requests.

You see your posibilities are nearly unlimited :-)

HTH
Tino Wildenhain

--On Donnerstag, 26. April 2001 23:35 +0100 Lee <lee.reilly@ntlworld.com> 
wrote:

> Hi there,
>
> I have a question about Zope's ability to interact with C programs. I
> don't know the *exact* details yet, but hopefully they shouldn't be
> (too) necessary for you to give me your opinions. Okay, a piece of
> software has been developed in C to analyse experimental data - lots of
> number crunching, etc. This is running on a *seperate* machine (or
> possibly array or machines).
>
> They (the developers) want a Web portal developed to interact with this
> software - yup, I expect the CMF (nee PTK) could be used here. The
> portal would facilitate (obviously) user accounts, data storage, etc.
> and would have to facilitate a whole bunch of functions supported by the
> C programs - data analysis, data visualisation, etc.
>
> E.g. a C program is running somewhere and the user enters information
> through Zope. Actually, I think the data would be held on a database
> before it is processed. Okay, so data from Zope / a database is sent to
> a C program, processed, and the output is returned to the user through
> Zope and displayed in the browser.
>
> Basically, I am asking how feasible it would be to use Zope to interact
> with C programs - to provide input for and display its output. If its a
> problem, then I expect that Zope and the C programs could be run on the
> same machine. It would not be possible to re-implement the software in
> Python - well, I suppose it would, but it's quite a large piece of
> software that has taken a few years to develop.
>
> I would appreciate a few different points of view. Of course, if all of
> the above is possible then a simple "yes" would suffice - or two "yes's"
> just to be on the safe side ;-)
>
> Thanks very much for your thoughts,
>
> - Best regards,
>
> Lee
>
> --
> Lee Reilly
> mailto:lee.reilly@ntlworld.com
> http://www.footkick.co.uk/lee
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )