Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use the function 'execfile' to call a second python from a primary one. If psspy is used in the second python file, it will have to be imported explicitly. calling a second.py:

 execfile(second.py,globals(),locals())    #globals and local can be omitted

All variables available in primary.py will be made available also to second.py!!
Now, at the beginning of second.py:

sys.path.append(r'C:\Program Files (x86)\PTI\PSSE33\PSSBIN')  # psse\bin path where psspy is located
import psspy
#psspy.psseinit(80000) #only if psse was not started

You can use the function 'execfile' to call a second python from a primary one. If psspy is used in the second python file, it will have to be imported explicitly. calling a second.py:

 execfile(second.py,globals(),locals())    #globals and local can be omitted

All variables available in primary.py will be made available also to second.py!!
Now, at the beginning of second.py:

sys.path.append(r'C:\Program Files (x86)\PTI\PSSE33\PSSBIN')  # psse\bin path where psspy is located
import psspy
#psspy.psseinit(80000) #only if psse was not started
_i = psspy.getdefaultint()
_f = psspy.getdefaultreal()
_s = psspy.getdefaultchar()