First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

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

asked Jul 13 '17

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?

2 answers

Sort by » oldest newest most voted
0

answered Jul 18 '17

knucklehead gravatar image

updated Jul 18 '17

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

link
0

answered Jul 14 '17

frederickgp7 gravatar image

updated Jul 14 '17

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.

link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Jul 13 '17

Seen: 1,174 times

Last updated: Jul 18 '17