Backward compatible of Python 2 and Python 3

Lele Gaifax lele at metapensiero.it
Mon Jun 5 05:35:50 EDT 2017


Pradeep Patra <smilesonisamal at gmail.com> writes:

> I want to make a program which works in both python 2.7 and python 3. Is it
> possible?

Definitely yes.

> For example python 2.7 have raw_input() to accept the input from command
> line whereas python 3.x method is input().

One popular way of doing that is by using
https://pypi.python.org/pypi/six/1.10.0

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it  |                 -- Fortunato Depero, 1929.




More information about the Python-list mailing list