0

Using a shell the following command works:
idl -e 'eventtester, "TEST123", config_file="path/to/configuration.ini"'

But when it is run from python through

pipes = subprocess.Popen('idl -e \'eventtester, "TEST123", config_file="path/to/configuration.ini"\'', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
std_out, std_err = pipes.communicate()
pipes.wait()

The only output I get on stdout is:

IDL 8.7.0 (Win32 x86_64 m64).
(c) 2018, Harris Geospatial Solutions, Inc.

Licensed for use by: XXXXX
License: XXXXXXX
License expires XXXXX.

So it seems like IDL is just running without any arguments for some reason.
eventtester.pro is in the IDL lib path so I'm not sure what I'm doing wrong.

Edit: Not sure why but this is how I managed to get it to work:

pipes = subprocess.Popen('bash -c idl -e \'eventtester, "TEST123", config_file="path/to/configuration.ini"\'', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
std_out, std_err = pipes.communicate()
pipes.wait()
  • Unrelated to the actual question, but have a look at the IDL-Python bridge: https://www.l3harrisgeospatial.com/docs/python.html – jitter Dec 29 '20 at 23:29
  • I have looked into the official idlpy module but for some reason the IDL distribution provided by my institution does not have the dlls necessary to install it. I have also looked into other pip modules but they all don't work/don't support the windows platform. Thankfully I was able to solve my problem by adding `bash -c ` to my shell call – lorcalhost Dec 30 '20 at 13:56

0 Answers0