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

Home » Public Forums » archive » python bridge setup - IDL8.6.1 Mac OS X Sierra
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 bridge setup - IDL8.6.1 Mac OS X Sierra [message #94687 is a reply to message #94686] Sat, 19 August 2017 03:11 Go to previous messageGo to previous message
wallabadah is currently offline  wallabadah
Messages: 28
Registered: November 2005
Junior Member
Thanks for the quick response Chris, it's now much closer to working as it should, but not quite...

Running IDL code from python works as expected, using the following code from IDL Help (albeit with an error

>>> from idlpy import *
>>> import numpy.random as ran
>>> arr = ran.rand(100)
>>> p = IDL.plot(arr, title='My Plot')
(a plot is displayed)
Warning: Cannot convert string " -adobe-helvetica-medium-r-normal-*-*-120-75-75-p-*-iso8859-1 " to type FontStruct

Running python within IDL works as expected, using the following code form IDL help:

>>>
import matplotlib.pyplot as plt
import numpy.random as ran
arr = ran.rand(100)
p = plt.plot(arr)
plt.show()
(a plot is displayed)

But running python code at the IDL command line doesn't work:

ran = Python.Import('numpy.random')
arr = ran.rand(100) ; call "rand" method
plt = Python.Import('matplotlib.pyplot')
p = plt.plot(arr) ; call "plot", pass an array
void = plt.show(block=0) ; pass keyword
(no plot is shown, no error messages)

If you can provide any advice Chris I'd appreciated it, and I'm sure others on the list would appreciate it too.

On a related note, is there any documentation on how using one of the IDL bridges works with distributing software? If one was to develop an IDL application that used (for example) some python code via a bridge, and tried to distribute it using make_rt and the IDL virtual machine... I guess the end user would have to go through the process of setting paths and installing python just as I have been doing in the last few days? Seems a little tricky for the non-specialist... Are there plans to streamline the process?

thanks,

Will
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: bug with min/max and non-finite values
Next Topic: comparing two variables

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

Current Time: Wed Oct 08 16:03:15 PDT 2025

Total time taken to generate the page: 0.00191 seconds