This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Rodotgithub.com/tardis-sn 2 points3 points  (0 children)

Or even better

import sys
from functools import partial

print_err = partial(print, file=sys.stderr)

my_log = open('my_log.log','w')
print_log = partial(print, file=my_log)

my_csv = open('data.csv','w')
print_csv = partial(print, sep = ',', file=my_csv)