How to achieve forward compatible string literals in python?
Question: I've got a script which runs with python 3 except string literals. Python 2.x
force me to prefix string literals with u'' and python 3 dosen't understand
it. How to so solve that?


Answer: try this when running it in python 2.x:

    
    
    >>> from __future__ import unicode_literals
    >>> s=['xx','yy','zz','aa']
    >>> s
    [u'xx', u'yy', u'zz', u'aa']
    

same thing when executed in python 3.x:

    
    
    >>> from __future__ import unicode_literals
    >>> s=['xx','yy','zz','aa']
    >>> s
    ['xx', 'yy', 'zz', 'aa']
    

