Ask Your Question
0

Best way to read *.out file with PSSExplore34? Excel or python?

asked 2021-05-01 13:22:55 -0500

EMag gravatar image

updated 2021-05-04 15:02:08 -0500

Hi,

I want to perform some analysis on my PSSE *.out file and not sure what the best approach is, as I am struggling to setup python to use "pssexcel" or dyntools. Not sure if this issue is related to my setup or the fact I have PSSExplore 34. So any pointers or suggestions would be really helpful!

Thanks!

First, So far I have this code below, but keep getting errors when trying to run in python

import os
import sys
DIRECTORY_PATH =r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27'
PSSE_PATH = r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSBIN'

sys.path.append(DIRECTORY_PATH)
os.environ['PATH'] =+ ";" + PSSE_PATH 

import excelpy

I also followed a suggestion from other posts of running existing examples from PSSE installation. I tried running "dyntools_demo.py" and got the error:

Traceback (most recent call last):
  File "C:\Python27\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Program Files (x86)\PTI\PSSEXplore34\EXAMPLE\dyntools_demo.py", line 405, in <module>
    import psse34
ImportError: No module named psse34

Second, How do I import *.out file and "detect" all its entries? Or I need to know beforehand?

(added an update to the question, as it was not directly asked)

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2021-05-03 17:13:19 -0500

EMag gravatar image

updated 2021-05-03 17:13:42 -0500

Following the reply below from Jconto (who gets credit for this!), for those using PSSEXplore34 you need to look for "pssexplore34.py" (not psse34.py) and it must be in the same folder as "pssexcel.pyc" and "psspy.pyc" (can be in folder "PSSPY27" or "PSSPY34"). I amended the code from Jconto to reflect that and also some print phrases so you can check the code is running.

import os, sys
DIRECTORY_PATH =r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27'    #=psspy folder
sys.path.append(DIRECTORY_PATH)
import pssexplore34
print("Pssexplore initiated")
import excelpy
print("Excelpy imported sucessfully")
edit flag offensive delete link more
0

answered 2021-05-03 15:37:05 -0500

jconto gravatar image

Check the post "How to install modules in PSSEXplore34" in this forum to resolve the excel.py problem.

Also, check if the file "psse34.py" is in the psspy folder:

DIRECTORY_PATH =r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27'    #=psspy folder
sys.path.append(DIRECTORY_PATH)
import psse34
edit flag offensive delete link more

Comments

Thanks for replying! I will try those suggestions and then provide some feedback.

EMag gravatar imageEMag ( 2021-05-03 16:18:14 -0500 )edit

Thanks for the reply! That solved it, all I needed to change my file, as I am using PSSEXplore34 the file is named "pssexplore34.py" and I confirm its in the folder with "pssexcel.pyc" and "psspy.pyc", which I named my DIRECTORY_PATH above

EMag gravatar imageEMag ( 2021-05-03 16:58:14 -0500 )edit

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

Stats

Asked: 2021-05-01 13:22:55 -0500

Seen: 64 times

Last updated: May 04