| New Reply |
Python 2 vs Python 3 for Computational Tasks |
Share Thread | Thread Tools |
| Feb15-13, 08:07 PM | #1 |
|
|
Python 2 vs Python 3 for Computational Tasks
I've decided to learn Python (having a background in C++ and Matlab), and I'm a little unsure about which version to get. I've read in a few places that Python 2.x is better because packages like numpy and scipy don't work with Python 3.x, but this seems to be out of date since as far as I can tell, these packages do support Python 3.x now. I plan to do mostly do computations (e.g. modeling/simulation) and then visualizations of those computations. Have most of the important packages for this type of thing been ported over to Python 3.x or am I safer going with Python 2.x?
|
| Feb15-13, 08:34 PM | #2 |
|
|
This may help you with your decision. In my lab we use Python 2 since it's more supported. Python 3 is a cleaner, better language, but Python 2 still has a lot of inertia.
My advice would be to go with Python 3 if you can, keeping in mind much of the available Python code is still targeted at Python 2. If you do use Python 2, it's good practice to write code that is forward-compatible with Python 3. A simple example is the print functionality, which is a statement in Python 2, used as: Code:
print foo
Code:
print(bar)
Code:
from __future__ import print_function print(bar) |
| Feb16-13, 09:58 AM | #3 |
|
|
Kind of learn Python 2 and 3 in a encompassing way so that you write Python 2 in a 3-compatible manner...that way, you know for sure that no module is going to stop you from doing your work; THEN, when all modules have been ported and 3 is as complete as 2 is today...your code should be easy to port...I thought at some point they were writing a program that would convert your Python 2 code to Python 3...I bet it works good when Python 2 has already been written with Python 3 in mind. |
| Feb16-13, 10:13 AM | #4 |
Recognitions:
|
Python 2 vs Python 3 for Computational Tasks
This is the sort of issue that keeps "not for profit" software as a minority interest, unfortunately.
If the inventors of Python 2 have invented a "better" but incompatible language, good for them. But calling it "Python 3" and assuming that the rest of the Python community would instantly drop whatever else they were working on and port all their existing code was somewhere between "dumb" and "naive" IMO. As the old proverb says, sometimes "the best is the enemy of the good". |
| Feb16-13, 03:18 PM | #5 |
|
|
|
| Feb16-13, 05:49 PM | #6 |
|
|
It is precisely because Python is open source and "not for profit" that thegreenlaser actually has a choice! Nobody is forcing s/he to pick one or the other or to "move forward" onto a specific version. If it was proprietary software, licensed, etc...s/he could very well have no choice but to start using the present version of a software regardless of base, popularity, bug-iness, etc. and simply because the previous one is no longer available. Anyway, that's just one of the things software freedom is about. |
| Feb16-13, 05:56 PM | #7 |
|
|
|
| Feb16-13, 06:31 PM | #8 |
|
|
In addition, More versions of Python 2 are still released, what tells that Python 2 will not be out of date soon!!!! |
| Feb16-13, 10:19 PM | #9 |
|
|
http://www.python.org/download/releases/2.7.3/ |
| Feb17-13, 12:51 PM | #10 |
|
|
Thanks everyone. I guess there's no real clear consensus on this issue, so I've decided to go with Python 2 just because of bigger library and better supporting documentation. As a casual programmer doing stuff for myself I'm guessing it won't make all that much of a difference in the end.
|
| Feb17-13, 01:15 PM | #11 |
|
Admin
|
|
| May7-13, 05:53 AM | #12 |
|
|
Sorry for digging up an old thread, but I wanted to ask the same question, only I have no experience with programming at all (besides a little bit of Matlab), and I want to start by learning Python. I can't really tell from this thread which version is best, lol.
On their website they say Thanks. Edit: saying "if you don't know, try Python 3.3" sounds a little sneaky to me... I did read this page, and it's all Greek to me, no help at all. |
| May7-13, 06:28 AM | #13 |
|
Admin
|
|
| May7-13, 06:46 AM | #14 |
|
|
"Here, try this..." "What is it?" "Just try it..." I would feel more assured if they said "If you don't know which version to use, download 3.3.1" or something like that, but that's being silly, I know. |
| May7-13, 11:10 AM | #15 |
|
|
For my business, the most tragic victim of such a "drop" would be our usage of omniORBpy for CORBA prototyping and development scripting. No way. None at all. |
| May13-13, 10:34 AM | #16 |
|
|
I have still found this thread of very little help. Accidentally I found this, from this page (under "Warnings for Beginners"):
I just wanted to add this for other beginners who can find no guidance on this topic. |
| May13-13, 11:09 AM | #17 |
|
Admin
|
Have you run into any problems because you use 3.3?
|
| New Reply |
| Thread Tools | |
Similar Threads for: Python 2 vs Python 3 for Computational Tasks
|
||||
| Thread | Forum | Replies | ||
| Compile Python, Matlab and Python | Programming & Comp Sci | 3 | ||
| help in Python rk4 | Programming & Comp Sci | 1 | ||
| [B]Problem statement:[/B]If you have a list, how do you count the | Engineering, Comp Sci, & Technology Homework | 2 | ||
| Help in Python for Computational Physics | Advanced Physics Homework | 0 | ||
| Python rk4 | Programming & Comp Sci | 0 | ||