First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Okay, I solved it. The boilerplate code didn't recompile until I closed PSSE which is why my error changed today. The problem I was having yesterday is that the boilerplate code needed to import psspy for some reason, even though it was running in PSSE (GUI). The code for importing is:
import os
PSSE_LOCATION = os.path.join('C:', os.sep, 'Program Files (x86)', 'PTI', 'PSSE34','PSSPY27')
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] + PSSE_LOCATION +';'
import psspy from psspy import _i,_f, _s
The code would not run without this importing. The main code did not need to import it, but the boilerplate did.
So, importing a custom Python file works just fine, just make sure to import psspy in the custom file and close and reopen PSSE after changing code in the custom file so it can recompile.
2 | No.2 Revision |
Okay, I solved it. The boilerplate code didn't recompile until I closed PSSE which is why my error changed today. The problem I was having yesterday is that the boilerplate code needed to import psspy for some reason, even though it was running in PSSE (GUI). The code for importing is:
import sys, os
PSSE_LOCATION = os.path.join('C:', os.sep, 'Program Files (x86)', 'PTI', 'PSSE34','PSSPY27')
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] + PSSE_LOCATION +';'
import psspy from psspy import _i,_f, _s
The code would not run without this importing. The main code did not need to import it, but the boilerplate did.
So, importing a custom Python file works just fine, just make sure to import psspy in the custom file and close and reopen PSSE after changing code in the custom file so it can recompile.
3 | No.3 Revision |
Okay, I solved it. The boilerplate code didn't recompile until I closed PSSE which is why my error changed today. The problem I was having yesterday is that the boilerplate code needed to import psspy for some reason, even though it was running in PSSE (GUI). The code for importing is:
import sys, os
PSSE_LOCATION = os.path.join('C:', os.sep, 'Program Files (x86)', 'PTI', 'PSSE34','PSSPY27')
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] + PSSE_LOCATION +';'
import psspy from psspy import _i,_f, _s
The code would not run without this importing. The main code did not need to import it, but the boilerplate did.
So, importing a custom Python file works just fine, just make sure to import psspy in the custom file and close and reopen PSSE after changing code in the custom file so it can recompile.
EDIT
After reading through the docs some more, an easier version of the code above is:
import psse34
import psspy
from psspy import _i, _f, _s