Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Not sure if you knew this or not, but there is actually a built in psspy attribute, throwPsseExeption, that does something similar.

For example:

psspy.throwPsseException = True
psspy.case(r"nonexistantFile")

will output:

File not found. nonexistantFile.sav (OpnApplFil/OPNPTI)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".\psspy.py", line 3755, in case
psspy.CaseError: case Error: ierr=3

Python Exception raised!

I am not trying to rain on your parade because it was pretty neat you were able to create your own, just giving another method.