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
On Thu, Apr 26, 2001 at 11:35:26PM +0100, Lee wrote:
Hi there,
[Some questions about working with C programs snipped] Essentially, if you can get the data back quickly enough, you should have no problem. (You don't want the browser to time out waiting for a response). You have two major options in working witht the programs, both probably involve External methods. you can invoke the 'C' program from a system call and have it drop something into a LocalFS accessible directory. Or you can pipe something. This is oten a matter of taste, but in the case of visualiztion, may not be. For example. I am working the following system. I have engineering (ACAD) drawings on several servers and a database that keeps a name to URN correspondence. Once a drawing is requested, it is pulled back to the Zope server (via rsync), and converted to any of several JPEGs, PNGs, PDFs, or PS files. These may be put in a filespace for viewing, or they may ve piped directly to a printer. Again, the only question is speed, make sure you get back to the browser in a timely manner. Jim Penny
- 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 )
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 )
hi, it is entrirely possible for zope to interface with C and C++. we use the C++ module for MySQL fairly extensively, and basically what you do is write an external method that defines various functions which take as parameters the variables you need to feed to the program, then have the python program launch the application passing it the parameters. the python program can then return the resulting data back to zope, where, should that be necessary, you can set up a formatted display of the results data. hth. ciao! greg. Gregory Haley DBA/Web Programmer Venaca, LLC.
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.
participants (4)
-
ghaley@mail.venaca.com -
Jim Penny -
Lee -
Tino Wildenhain