saving_stdout -> redirecting_stdout (Phillip Eby).
This commit is contained in:
parent
944216964a
commit
b96d41a65f
|
@ -581,7 +581,7 @@ Examples
|
||||||
|
|
||||||
7. Redirect stdout temporarily:
|
7. Redirect stdout temporarily:
|
||||||
|
|
||||||
def saving_stdout(new_stdout):
|
def redirecting_stdout(new_stdout):
|
||||||
save_stdout = sys.stdout
|
save_stdout = sys.stdout
|
||||||
try:
|
try:
|
||||||
sys.stdout = new_stdout
|
sys.stdout = new_stdout
|
||||||
|
@ -592,7 +592,7 @@ Examples
|
||||||
Used as follows:
|
Used as follows:
|
||||||
|
|
||||||
block opening(filename, "w") as f:
|
block opening(filename, "w") as f:
|
||||||
block saving_stdout(f):
|
block redirecting_stdout(f):
|
||||||
print "Hello world"
|
print "Hello world"
|
||||||
|
|
||||||
Acknowledgements
|
Acknowledgements
|
||||||
|
|
Loading…
Reference in New Issue