3

print pss report to a file

Hello, I'm pretty new to pss and python in general, but I've made a few scripts. I have a problem, I want to export the contents of a report to a text file. I tried with this, but didn't manage to get it working:

f1=open('./testfile3.txt', 'w+')

psspy.zsys(0,4,[22,30,31,32])

psspy.zone_2(0,0,1)

print >> f1, psspy.zone_2(0,0,1)

keesem's avatar
31
keesem
asked 2013-06-04 06:26:05 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

You're not far off. You just need to redirect the report output to a file. This is because the zone_2() function doesn't return the text of the report, it returns an error code.

# Redirect generated reports to a file
psspy.report_output(islct=2, filarg="./testfile3.txt", options=[0])
# Run any functions that create a report
psspy.zsys(0,4,[22,30,31,32])
psspy.zone_2(0,0,1)
# Redirect reports back to the default
psspy.report_output(islct=2, options=[0])
Eli Pack's avatar
823
Eli Pack
answered 2013-06-05 22:08:49 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks a lot, it works perfectly! :)

keesem's avatar keesem (2013-06-06 01:13:21 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer