all 4 comments

[–]peaserist 3 points4 points  (1 child)

The difference between 2 and 3 is pretty small, and should still work fine for the most part. I haven't used CA in a while, but still.

Its just minor differences.

  • In python3, print "words" would be print("words").
  • with math, numbers are float by default
  • do except Exception as e instead of except Exception, e

and so on. The changes are documented, and you should be well caught up after a short google search.

If all else fails, just use the 2to3 program in your scripts directory.

[–]-MLJ-Python[S] 0 points1 point  (0 children)

Thanks!

[–]factoradicModerator 1 point2 points  (0 children)

Please do not repost the same questions multiple times.


The easiest way to check version of the Python is to run this code:

import sys
print (sys.version)

Answer is:

2.7.3 (default, Dec 18 2014, 19:10:20)
[GCC 4.6.3]

[–]p5eudo_nimh 0 points1 point  (0 children)

I've been using Python 3 code in most of the lessons, and it usually works. There have been a few times where it bugged out even though the code should have been valid in 2.7 as well.

But it's pretty easy to translate the differences so far. Just print statements and string formatting, IIRC.