Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is there an API call to get existing Channel arrays directly into Python?

I'm trying to load all existing channel data (ID, name, desc) from a snapshot into a python dictionary so it can be searched to avoid adding duplicate channels later on in my script. Is there any way to get the data from the API directly into a list or dict array?

All I've found is the following process:

psspy.report_output(2,"chan.txt",[1,0])
ierr = psspy.dlst(1,5)
# then open the text file chan.txt
# then parse the text in the report to build my list/dict manually

It would be ideal if I could avoid the cumbersome process of saving out a text report only to read it back in and split the text into a usable Python dictionary. I was hoping there was an API that had the data come out in arrays directly similar to the PSSARRAYS functions for ACCC data.