Temple of The Roguelike Forums
Development => Programming => Topic started by: Alex E on October 22, 2012, 12:58:22 AM
-
Lately I've been trying to learn how to program in Python, and I've run into a problem.
I've been using Python 3.3.0 (The latest version), but it doesn't support too many libraries yet, such as Pygame. I can switch using versions at any time, but I'm not sure which version to use.
Anyone who knows a bit about Python want to give me some advice? What's the main difference between all these versions? And why are so many people still using v2.7.3 instead of the 3.x versions?
-
Anyone who knows a bit about Python want to give me some advice? What's the main difference between all these versions? And why are so many people still using v2.7.3 instead of the 3.x versions?
To quote the Python website: "Python 3.0, also known as “Python 3000” or “Py3K”, is the first ever intentionally backwards incompatible Python release."
Basically, a lot of the old 2.x libraries haven't switched over to 3.x yet because of the API changes. A ton of old 2.x code doesn't work on 3.x and would be a lot of work to port over.
When 3.x was introduced they replaced or removed parts of the API instead of just deprecating them (like Sun/Oracle does with the Java API), which caused somewhat of a stink.
They're slowly porting stuff over now, I think libtcod is already 3.x-compatible if you do some things.
-
To quote the Python website: "Python 3.0, also known as “Python 3000” or “Py3K”, is the first ever intentionally backwards incompatible Python release."
Basically, a lot of the old 2.x libraries haven't switched over to 3.x yet because of the API changes. A ton of old 2.x code doesn't work on 3.x and would be a lot of work to port over.
When 3.x was introduced they replaced or removed parts of the API instead of just deprecating them (like Sun/Oracle does with the Java API), which caused somewhat of a stink.
They're slowly porting stuff over now, I think libtcod is already 3.x-compatible if you do some things.
In that case, I'll probably just stick with 3.x since, as you said, they are porting stuff over to it.
-
One problem is that end users tend not to have multiple pythons installed, especially on Windows where you can only have one version. To ensure your game can be played you should stick with 2.7.