psspy.lout and save to txt
Hi,.
How can i save the bus based report [ psspy.lout(0,1)] to text file?
Regards
add a comment
First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
Hi,.
How can i save the bus based report [ psspy.lout(0,1)] to text file?
Regards
import os, sys
PSSELOCATION = r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN" sys.path.append(PSSELOCATION) os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION
import glob import psspy import redirect
for CASE in glob.glob(os.path.join('C:\Users\tshipam\Desktop\SAPP temp\PSSE Engine mode\', '*.sav')):
psspy.psseinit(12000)
psspy.case(CASE)
psspy.throwPsseException = True
#psspy.fnsl(
#options1=0, # disable tap stepping adjustment.
#options5=0, # disable switched shunt adjustment.
#)
psspy.fdns([1,0,0,0,0,0,99,0])
conFile = open('report.txt', 'w')
conFile.write('Started writing to file by Mutenda Tshipala')
conFile.write('\n\n')
# Redirect generated reports to a file
psspy.report_output(islct=2, filarg="./" + 'report' + '.txt', options=[0])
##psspy.report_output(islct=2, filarg="./" + 'report' + FileNumber + '.txt', options=[0])
# Run any functions that create a report
psspy.lout(0,1)
# Redirect reports back to the default
psspy.report_output(islct=2, options=[0])
##conFile.write('Finished writing to file by Mutenda Tshipala')
conFile.close()
Asked: 2017-05-12 11:18:43 -0500
Seen: 1,792 times
Last updated: May 16 '17