Python interactive library(pymidas) session warning

66 views Asked by At

I'm using Python2.7 and a library called pymidas.

Within my python script I call the library with the following comand:

from pymidas import midas
midas.do('INDISK/FITS test.fits test.bdf')

All the code that I have further written does exactly what I want, but whenever the script imports midas I first get a welcome output of (py)midas, which is ok with me, but afterwards it asks me if I want a parallel or a new session.

Saddly this point needs human interaction in selecting parallel mode. By reading the documentation of midas I found, that midas has an option (-P) which causes exactly what I need, and forces midas to open without any questions asked and directly going to parallel mode.

Does anybody know how to achieve this in my python script?

Thanks!

1

There are 1 answers

0
Roman On BEST ANSWER

At the end of your script add :

midas.do('.exit')

This ensures you dont get asked the next time you run the script.