Search code examples
pythonbashprintingidl

How to disable bash messages when using PyIDL?


I have a code that imports PyIDL and runs a specific method. But everytime shows compiling messages, which is kind of annoying when I want other informations printed together.

import pidly    
idl = pidly.IDL()
idl("p_read, '"+pathIMG+"', h, p")
idl("header = h")

A example:

% Compiled module: P_READ.

% Compiled module: P_RHEAD.

% Compiled module: P_PDS_RHEAD.

...

So, how could I disable it?


Solution

  • You can control these things from IDL:

    idl('!quiet = 1')
    

    But, be warned that this will also disable other informational message besides just the compiled messages, i.e., anything like:

    message, 'this is an informational message', /informational
    

    It will not disable error messages.