Ask Your Question

PSSE to Python and run from inside of the PSSE

asked 2022-09-20 18:00:02 -0600

sobhanB gravatar image

I am trying to run the psse with python. I am using psse35.3 and python 3.9. My problem is that I am able to run my python code from inside of the psse but when I want to run my model from python, I can not get any results!

I really appreciate it if anyone has some idea about that and shares it with me. Thanks

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2022-09-20 20:50:58 -0600

Alex_barajas gravatar image

Hey! you'll need to import PSSe to a python script. I'll copy an example below. you'll need to update the paths with the location of your PSSe install on your machine.

import os,sys

# Path stuff
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSPY37")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSBIN")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSLIB")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE")
os.environ['PATH'] = (r"C:\Program Files\PTI\PSSE35\35.3\PSSPY37;" 
  + r"C:\Program Files\PTI\PSSE35\35.3\PSSBIN;" 
  + r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE;" + os.environ['PATH'])

import psse35

import psspy

case_file = '../input_files/case14.raw' # update this with a path to an example case, case_file)
edit flag offensive delete link more


Thank you so much. It works in my case.

sobhanB gravatar imagesobhanB ( 2022-09-21 12:23:29 -0600 )edit

answered 2022-09-21 04:44:07 -0600

perolofl gravatar image

It is normally very easy to start PSSE-35 from python. It is no longer needed to add libraries to the system path. This will start the newest installation of PSSE-35:

import psse35
import psspy
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

1 follower


Asked: 2022-09-20 18:00:02 -0600

Seen: 153 times

Last updated: Sep 21 '22