comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Python and IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Python and IDL [message #39631 is a reply to message #39570] Thu, 03 June 2004 06:21 Go to previous messageGo to previous message
Stein Vidar Hagfors H[2] is currently offline  Stein Vidar Hagfors H[2]
Messages: 28
Registered: October 2002
Junior Member
Michael Wallace <mwallace.no.spam@no.spam.swri.edu.invalid> writes:

> I'm probably the only person here who'd be interested in this, but I
> guess I'll throw it out anyway.

Well, you're not quite alone ;-)

[...]
> Currently, in my Python programs I open a pipe to an IDL process and
> write the IDL commands to the pipe. What I'm wondering is if there is
> an efficient way to send data from IDL back to Python. The only thing
> I've found so far is to have IDL write data to stdout and set up the
> Python side to read this stream. However, this can get pretty
> inefficient at times. Without any direct conversion between the two
> languages available, are there any other (i.e. better, efficient) ways
> to set up bi-directional interprocess communication between Python and
> IDL?

My advice would be to use remote procedure calls (RPC) from python to
an instance of IDL running as an RPC server. It would need some
development of wrapper routines callable from python (written in
c). For the IDL side of it, look at the files in
$IDL_DIR/external/rpc/. The example.c is a bare-bones example of how
to connect & send command lines to IDL. Look at e.g. idl_rpc_test.c to
see examples of how to use the numerous features.

With RPC calls, you can set or get variables "directly". For even more
efficiency, one could even build IDL & python together using Callable
IDL.

> What'd be really nice is if RSI provided some mechanism for IDL and
> Python to communicate at a much closer level than interprocess
> communication. Karl, that's a hint. ;-)

It would be nice, yes. Due to the large body of legacy code that many
projects around here are relying on, the likelihood of switching
entirely to python is very small. But a number of people would prefer
using python for the "scripting" parts of a data processing pipeline.

--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO

NASA Goddard Space Flight Center, Tel.: 1-301-286-9028
Mail Code 682.3, Bld. 26, Room G-1, Cell: 1-240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Polar Surfaces?
Next Topic: FILE_SEARCH() issue.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 02:33:27 PDT 2025

Total time taken to generate the page: 0.57005 seconds