Problems stopping or halting PSSE in a Python script
I am having some issues stopping or halting PSSE.
When I use psspy.stop_2(), PSSE stops successfully but my python code also stops executing and the interpreter closes, preventing the rest of my program from running. Why does stop_2 have the power to crash the python interpreter?
When I use psspy.halt_2(), one of the following happens, depending somehow on whether the PSSE GUI has been running or IDLE has been re-started since the last attempt.
1) PSSE halts successfully allowing my code to continue executing, but the usual message box telling me how many hours are left on my hourly dongle appears and pauses the execution of pyton code until dismissed manually. The message box can be somewhat annoying and reduces the effectiveness of my program.
2) PSSE crashes and displays a message box: "Failure of license thread! Please shutdown this program within 1 minute and then notify PTI." Sometimes Python continues executing my code after this and sometimes Python crashes too before finishing my program.
I have also noticed that sometimes, even though there is no visible evidence of PSSE or python running, my hours get used up after running a python script. This is one reason that I would like to reliably stop PSSE in my scripts. The other reason is that I would like to be able to compile a DLL and then restart PSSE in order to load the new DLL, all within the same script.
I am using PSSE V32.1.2 - hourly dongle license, Python 2.5.1, Windows 7.