Silence!
PSSE prints a voluminous amount of information to the command line when you are running a program. Do you remember seeing this when you start PSSE up?
1 2 3 4 5 6 |
|
We will show you a little function that you can use to selectively turn off this output (and other PSSE output) or redirect it to a log file.
This blog post is in response to a question by chip on the python for power systems engineers forum. Chip wanted to ignore some of the output that PSSE was printing without ignoring all of the program’s output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
The function silence
can be used to selectively turn off PSSE output printing in your program. Use it like this:
1 2 |
|
Printing from within the context block (the with
statement) will be ignored.
(Note that we have
initialised PSSE with buses
set to ten thousand – based on our research of the optimal bus number).
What if you must redirect the PSSE output to a file? Got you covered. Use the silence function like this:
1 2 3 |
|
There are more juicy details about how the context manager works on the forum: Silencing PSSE Stdout
edit: You must also redirect PSSE output to Python using the redirect
module included with every PSSE installation:
1 2 3 4 5 6 |
|