Apr-25-2017, 06:16 AM
(Apr-24-2017, 10:10 AM)wavic Wrote: In Python everything is an object.
Save it somewhere temporarily.
import sys stdout_bak = sys.stdout # some code sys.stdout = output_back
i'm assuming you meant for stdout_bak and output_back to be the same.
how do i get what the function that is called prints with the
print(file=foo)
function after it is done? i can pass foo (a python file-like object) to the function. but the function closes it (e,g. it does foo.close()
). i tried making foo be a StringIO object, but that fails because of the close.the function is in a module in .pyo format.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.