[python-win32] Porting code from Python 2.x code to Python 3.x

Santosh Mohan santosh.mce at gmail.com
Thu Jan 7 06:40:51 CET 2010


HI,

I installed new version of Python 3.1. I tried to run my older programs, but
I couldn't run.

I had used "print" statements, in Newer version print statement syntax is
changed.

Python2.x
>>>x=20
>>>print x
>>> 20

Python 3.x
>>>x=20
>>> print x
  File "<stdin>", line 1
    print x
          ^
SyntaxError: invalid syntax
>>>print(x)
>>>20

Is there any utility for running the older version programs?


Regards,
Santosh M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20100107/1745857e/attachment.htm>


More information about the python-win32 mailing list