Some of this stuff depends on features that aren't in older Python versions out of the box and you might need to do this if you're e.g. building a library that you want to support older Python versions.
from__future__importprint_function
Honestly I've almost never found any practical use for these things, format strings are much better for actually building output.
I think I've tried to use file=sys.stderr a few times.
Yeah, you’ve got a good point there. I’ll edit the post so that it says which versions of python this sort of functionality is compatible with. Thanks for the tip!
Some of this stuff depends on features that aren't in older Python versions out of the box and you might need to do this if you're e.g. building a library that you want to support older Python versions.
Honestly I've almost never found any practical use for these things, format strings are much better for actually building output.
I think I've tried to use
file=sys.stderra few times.Yeah, you’ve got a good point there. I’ll edit the post so that it says which versions of python this sort of functionality is compatible with. Thanks for the tip!
Change the post to reflect that it only works on Python 3.0 and up. Thanks again for the heads up!