Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to read *.out file to Excel using Python with PSSExplore34?

Hi,

I have been reading other questions related to my question (Reading .out file with Excel, About psse v33 to excel, .out output file + excel), but I didn't manage to get my code running and more doubts I am hoping you are able to help me with.

Background: using PSSEXplore34 and Visual Studio 2019 for python.

My questions are:


1) Defining python code the right directories to run PSSE and read the existing python imports : Keep getting "unresolved import" errors - am I missing something in the code below specific to Xplore34?

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

2) How do I specify to read a *.out file in a specific folder? Where do I specify my folder? (e.g. "C:\Users\Username\Documents\PSSE_outfiles"). I saw another post on this forum, mentioning using dyntools ("Reading .out file with Excel")


Thank you and I hope I didn't miss another post on this topic.

How to read *.out file to Excel using Python with PSSExplore34?

Hi,

I have been reading other questions related to my question (Reading .out file with Excel, About psse v33 to excel, .out output file + excel), but I didn't manage to get my code running and more doubts I am hoping you are able to help me with.

Background: using PSSEXplore34 and Visual Studio 2019 for python.

My questions are:


1) Defining python code the right directories to run PSSE and read the existing python imports : Keep getting "unresolved import" errors - am I missing something in the code below specific to Xplore34?

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

2) How do I specify to read a *.out file in a specific folder? Where do I specify my folder? (e.g. "C:\Users\Username\Documents\PSSE_outfiles"). I saw another post on this forum, mentioning using dyntools ("Reading .out file with Excel")


Thank you and I hope I didn't miss another post on this topic.

How to read *.out file to Excel using Python with PSSExplore34?

Hi,

I have been reading other questions 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 question (Reading .out file with Excel, About psse v33 to excel, .out output file + excel), but setup or the fact I didn't manage to get my code running and more doubts I am hoping you are able to help me with.have PSSExplore 34. So any pointers or suggestions would be really helpful!

Background: using PSSEXplore34 and Visual Studio 2019 for python.Thanks!

My questions are:


So far I have this code below, but 1) Defining python code the right directories keep getting errors when trying to run PSSE and read the existing python imports : Keep getting "unresolved import" errors - am I missing something in the code below specific to Xplore34?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

2) How do I specify to read a *.out file in a specific folder? Where do I specify my folder? (e.g. "C:\Users\Username\Documents\PSSE_outfiles"). I saw another post on this forum, mentioning using dyntools ("Reading .out file with Excel")


Thank you and I hope I didn't miss another post on this topic.

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

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!

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

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

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!

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

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

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)

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

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, 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, 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)