First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
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()