First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
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
2 | No.2 Revision |
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()