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

Home » Public Forums » archive » Calling a Python script from IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Calling a Python script from IDL [message #40003] Wed, 07 July 2004 09:45 Go to next message
lwelser is currently offline  lwelser
Messages: 2
Registered: April 2004
Junior Member
Is there a way to call a Python script from within IDL and have it
return information to the IDL program? (Python is an object-oriented
scripting language similar to perl and java). I'm working on
visualizing huge amounts of data in an IDL widget, and a python script
to parse through this data is already in existance.
Thanks,
Leslie Welser
Re: Calling a Python script from IDL [message #40059 is a reply to message #40003] Sun, 11 July 2004 15:54 Go to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
>> Is there a way to call a Python script from within IDL and have it
>> return information to the IDL program? (Python is an object-oriented
>> scripting language similar to perl and java). I'm working on
>> visualizing huge amounts of data in an IDL widget, and a python script
>> to parse through this data is already in existance.
>> Thanks,
>> Leslie Welser

You could open a python process with SPAWN and then use shared memory to
send data between the processes. Since you're working on "huge amounts
of data," shared memory would probably be the easiest way to go. The
gotcha to this is that you will probably have to be careful how you
read/write data to the shared memory to make sure that values are
converted between IDL and Python correctly. Don't know if that helps or
not. Happy trails,

-Mike
Re: Calling a Python script from IDL [message #40064 is a reply to message #40003] Sun, 11 July 2004 11:03 Go to previous message
cedricl is currently offline  cedricl
Messages: 8
Registered: July 2004
Junior Member
It depends on how involved your script is. If you're on Unix, you
could maybe use a Unix pipe with the IDL command "spawn". Something
like "spawn, 'python myscript.py'". Look at the external development
guide.

I have never used a Unix pipe myself, so I'm not sure if they can
support "huge amounts of data", or how a Python program can manage
this data coming from the standard input...

Cedric

lwelser@physics.unr.edu (Leslie Welser) wrote in message news:<c870f808.0407070845.74d8e68c@posting.google.com>...
> Is there a way to call a Python script from within IDL and have it
> return information to the IDL program? (Python is an object-oriented
> scripting language similar to perl and java). I'm working on
> visualizing huge amounts of data in an IDL widget, and a python script
> to parse through this data is already in existance.
> Thanks,
> Leslie Welser
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: FFT Exasperation
Next Topic: Re: FFT Exasperation

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

Current Time: Wed Oct 08 19:20:13 PDT 2025

Total time taken to generate the page: 0.00653 seconds