On Thu, Nov 8, 2018 at 4:12 AM Chip Wachob <[email protected]> wrote:
> I should have mentioned that I'm working with Python 2, but I think I
> can parse my way through these examples.
You can use any of the `print` function tricks above in Python 2 with
the following boilerplate:
from __future__ import print_function
import sys
_orig_print = print
def print(*args, **kwargs):
flush = kwargs.pop('flush', False)
_orig_print(*args, **kwargs)
if flush:
file = kwargs.get('file', sys.stdout)
file.flush()
When you get to upgrade to Python 3, just throw the above code away
and things will work just the same :)
--
Zach
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor