Put the following code in the py3k.py module and import it as follows: from py3k import * . However, you need to put it in every file, but you can even leave it there if no one else uses Python 2.x, or you can just search and replace the import string with a space, and then delete the file.
try: from future_builtins import * except ImportError: pass try: input = raw_input range = xrange except NameError: pass
And this is what my template file looks like:
#!/usr/bin/env python # -*- coding: utf-8 -*- """ """ from __future__ import division, absolute_import, \ print_function, unicode_literals from utils.py3k import * # @UnusedWildImport #
Joschua Oct 06 '13 at 18:58 2013-10-06 18:58
source share