1 | initial version |
In the PSSe GUI, the "output bar" receives all messages and prints by default. In a python script, since there is no external CMD prompt window open (=DOS window), there is no need to redirect to ''PSSE2PY', and actually, it is an 'PSSe error' to try to do that.
Also, only when PSSe GUI starts, the path needed to access psspy or other PSSe modules is set internally, hence, no need to define it again in the syspath variable. The module 'psspy' is loaded and 'psseinit()' is executed internally.
Run the code below in the PSSe GUI :
# hello.py
print('Welcome to hello.py')
import sys, os
import time
import socket
#sys.path.insert(0, 'C:\Program Files (x86)\PTI\PSSE34\PSSBIN')
#os.environ['PATH'] = 'C:\Program Files (x86)\PTI\PSSE34\PSSBIN' + ';' + os.environ['PATH']
#import psspy
#import redirect
import pssarrays
#redirect.psse2py()
psspy.case(r"C:\Program Files (x86)\PTI\PSSE33\EXAMPLE\savnw.sav"