Ask Your Question
0

Need Python Script to Open PSSE v34

asked 2021-02-22 13:27:22 -0500

damiensommer gravatar image

updated 2021-02-22 13:39:18 -0500

I have a python script I've been using to for a few years that would open PSSE and run some analysis for me if I just double clicked the .py script from my virtual desktop. I really liked that I didn't have to open PSSE and then load the python script. This is the code that is in my script that used to work in v33 to open PSSE and get it ready to run my functions:

import os,sys
PSSBINPATH = r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN"
sys.path.append_PSSBINPATH)
os.environ['PATH'] = PSSBINPATH + ';' + os.environ['PATH']
import psspy, redirect, re
redirect.psse2py()
psspy.psseinit(150000)
import dyntools
import csv

I've tried a number of things I've seen on this forum to get it to open PSSE for me but nothing has worked. I updated the OS path to PSSE34\PSSBIN and I've tried setting the system path to the PSSPY27 and PSSPY37 folders. Neither worked. I have PSSE v34.8 and my PSSE is using python version 2.7.13.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2021-02-22 15:33:12 -0500

jconto gravatar image

Check the post "Python 3.7 w/ PSSE 34" for additional info. The 'auto' loading of a python script might not work with multiple python version, multiple PSSe versions on same machine.

Save the following as test34.py code:

import os, sys
PSSPY27PATH = r"C:\Program Files (x86)\PTI\PSSE34\PSSPY27"
sys.path.append(PSSPY27PATH)     #path to psspy for python 2.7
# import psse34                  #it replaces the above two lines
import psspy
import redirect
redirect.psse2py()
psspy.psseinit(150000)
import dyntools
import csv, re

Now, open explicitly the command prompt window (DOS window) provided with the installation of PSSe v 34, change directory to your working folder

c:\..>cd c:\...\wfolder

and type:

c:\..\wfolder>c:\python27\python test34.py
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

2 followers

Stats

Asked: 2021-02-22 13:27:22 -0500

Seen: 820 times

Last updated: Feb 22 '21