Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The code works fine (I use the savnw files) in v.35 with python 3.9, v.34 with python v.3.9.

Almost every psspy function can return an error code as explained in the API manual, like:

ier = psspy.case(...)

where ier = 0 means "No error". Did the "case" function return 0 (suggested check by @perolofl)?

A programming trick to stop the run at a point when an error occurs: put all python code of interest within a single for loop, and exit the loop when and error occurs:

for k in range(1):
    ier = psspy.case(path+'\B02_CASE01_P100_QZ000_SCR20_XR20.sav') 
    if ier: break
    ier = psspy.fdns([0,0,0,1,0,0,99,0])
    if ier: break
      ...