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