如何写出兼容python2和python3的代码

#python2
>>> print('sldk','ksl')
('sldk', 'ksl')
#python3
>>> print('slkd','skdj')
slkd skdj
from __future__ import print_function
import six
input = six.moves.input
from __future__ import division

http://python-future.org/compatible_idioms.html

你可能感兴趣的:(如何写出兼容python2和python3的代码)