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

Home » Public Forums » archive » 'True' python call
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
'True' python call [message #91855] Fri, 04 September 2015 06:31 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
[disclaimer1: I'm quite python ignorant...]

I'm trying this call to a function where I have to make a call using the "True" keyword, so that the call should look like this:
res = obj.method(keyword=True)

However, I cannot do this in IDL because it will tell me that the variable true is not defined. Very well. So I've tried using the following synthax options:
res = obj.method(keyword=1b)
res = obj.method(keyword="True")
res = obj.method(keyword='True')
res = obj.method(/keyword)
res = obj.method(keyword=Python.Run("True"))

All fail. Any suggestion how to do this?

The best try was this one:
[disclaimer2: save all your data. This will make the IDL session (IDLDE or command line) crash]

IDL> Python("True")
% Loaded DLM: PYTHON27.
% Type conversion error: Unable to convert given STRING to Long64.
% Detected at: PYTHON::INIT 19 C:\Program
Files\Exelis\IDL85\lib\bridges\python__define.pro

In fact any string will cause the same error/crash.
The reason is to be found in line 19 of python__define.pro (as shown above) where the parameter passed to the initialization of Python is only checked if it exists, not if it is a number.

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: data.sav
Next Topic: bug report

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

Current Time: Wed Oct 08 13:58:15 PDT 2025

Total time taken to generate the page: 0.00404 seconds