Ask Your Question
0

psspy.lout and save to txt

asked 2017-05-12 11:18:43 -0500

Mutenda gravatar image

Hi,.

How can i save the bus based report [ psspy.lout(0,1)] to text file?

Regards

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-05-16 11:59:38 -0500

Mutenda gravatar image

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

redirect.psse2py()

FileNumber = 1

Loop through cases

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()
edit flag offensive delete link more

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: 2017-05-12 11:18:43 -0500

Seen: 1,792 times

Last updated: May 16 '17