the function is written under normal filesystem assumptions it can be given a file name and will open it or be given an already open file object. in both cases it closes it when done writing. i have been giving it a filesystem file and when the function returns, open the file for reading and reading it.
i think what it does is:
it's a rather normal thing to close a file when done with it.
i think what it does is:
def function(...,file=None): try: o=open(file.fileno(),'w') except whatever: try: o=open(file,'w') except whatever: o=sys.stdout ... print(stuff.file=o) # many places ... o.close() returnor something similar like holding options in a dictionary.
it's a rather normal thing to close a file when done with it.
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.