Ask Your Question
0

How to omit PSSE output from printing when running from terminal?

asked 2017-07-13 09:29:03 -0500

peterjones gravatar image

I am running a script from the command line that opens a number of cases. Every time a new case is opened PSSE prints out its usual dialogue telling me what data it's reading in etc. How can I prevent this output to be omitted when running from the terminal?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-07-18 17:42:44 -0500

knucklehead gravatar image

updated 2017-07-18 17:55:41 -0500

I have used this approach:

tmpstdout = sys.stdout
HideProgress=True  

#WRITE TO 'NOWHERE' FILE (USED FOR HIDEPROGRESS) ----
class DummyFile(object):
    def write(self, x): pass

import redirect
redirect.psse2py()
if HideProgress==True: sys.stdout = DummyFile()
psspy.psseinit(buses=80000)                          #Any API that has Reporting or Progress
sys.stdout=tmpstdout

3phasee.com

edit flag offensive delete link more
0

answered 2017-07-14 11:27:46 -0500

frederickgp7 gravatar image

updated 2017-07-14 11:29:18 -0500

these commands silence the different reporting channels

ierr = psspy.prompt_output(islct = None)
ierr = psspy.report_output(islct = None)
ierr = psspy.progress_output(islct = None)
ierr = psspy.alert_output(islct = None)

these commands re-enable them

ierr = psspy.report_output(islct = 6)
ierr = psspy.progress_output(islct = 6)
ierr = psspy.alert_output(islct = 6)
ierr = psspy.prompt_output(islct = 6)

they behave weirdly when I run them right from Idle. But from within PSSE they work.

usually I create an echo method which shuts all reporting off but switches it back in for any output I need.

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-07-13 09:29:03 -0500

Seen: 1,133 times

Last updated: Jul 18 '17