Ask Your Question
3

print pss report to a file

asked 2013-06-04 06:26:05 -0600

keesem gravatar image

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)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-06-05 22:08:49 -0600

Eli Pack gravatar image

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

Comments

Thanks a lot, it works perfectly! :)

keesem gravatar imagekeesem ( 2013-06-06 01:13:21 -0600 )edit

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

Stats

Asked: 2013-06-04 06:26:05 -0600

Seen: 2,940 times

Last updated: Jun 05 '13