First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Your code is calling for psspy27 (to use with python 2.7) If that is the intention, the code looks fine else change to psspy34
To run PSSe 34 with python 2.7
My guess is that in your PSSe set up, the default python is v.3.4, generating the error when loading psspy for python 2.7 Try the following:
- Find the link use to open a Command Prompt window (DOS window). PSSe installation provides one on the desktop.
- Right click on that link, select properties and take note of the batch file name in the 'target' box.
- Edit the batch file ("C:\Program Files (x86)\PTI\PSSE34\SET_PSSE_PATH.BAT")
- Add a line to define the environ variable pythonhome as (do not leave spaces around the = char)
Set PYTHONHOME=c:\python27\
- Save the batch file as 'run3427.bat' and on a copy of the DOS link, update the target property, clear the 'Start in' box and rename the DOS link to __PSSe3427
To use it, put a copy of the __PSSe3427 link in your working folder and double click it. Now run your python code.
A separate link can be done for other PSSe/python pair versions (run3434.bat, ... run3539.bat). To verify the value assigned to the environ var 'pythonhome', enter SET on a DOS window.
In my pc, this is the content of the run3427.bat:
@rem run3427.bat
@echo OFF
Set PSSEVERSION=34
Set PYTHONCODE=%userprofile%\Documents\Code\Python\
Set PYTHONHOME=c:\python27\
SET PSSEPATH=%PROGRAMFILES(x86)%\PTI\PSSE%psseversion%\
SET PSSPYPATH=%PSSEPATH%\PSSPY27
SET PATH=%PYTHONHOME%;%PYTHONHOME%SCRIPTs;%pssepath%PSSBIN;%PATH%
Set INCLUDE=%pssepath%PSSLIB;%INCLUDE%
echo ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
echo %USERNAME%
echo %PYTHONCODE%
echo PATHs set for PSS/E-34 + python 2.7
echo ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
echo %date% %time%