What version of Python should I choose for beginners?

Source: Internet
Author: User
Tags shared hosting
As a beginner, with little Foundation, Python's Concise tutorials use 2.4.3, and the latest 3x novice tutorials are almost minimal.
How should I choose?

Reply content:

First look at the library you have to use. Unsupported 3, if supported, go directly to Py3:python tutorial
If you only support py2, then you can only Py2:python 2.7 tutorials Unless you're still maintaining the old version code, the bottom line for learning Python now is 2.6. Can no longer be below this version.

The simple Python tutorial is not a good textbook ... Learning Python and Python programming are 2.6-based, with 3.X, you can refer to

p.s. Add a link: How to write up-compatible Python code / http LUCUMR.POCOO.ORG/2011/1 /22/forwards-compatible-python/ should be 2.7 and 3.x to learn at the same time, learn the method is to learn 2.7, and then compare the 3.x improvements to understand the 3.x improved place

Reason: Because many libraries now only support 2.x, and 2.x the latest version is 2.7.3, learn this can be easily read the existing code and maintain good existing code.
3.x is the future Xie invited. Now it's 2014, start learning straight from 3. Most of the surviving Libraries support 3. If you find yourself always seeing 2 of the code in the process, it's not too late to learn 2. ArchLinux has been starting early with 3 as the default version, with a large six months, did not encounter any major problems (the small problems encountered all forgotten). Choose python3.x for the following reasons:
I started python in January this year and chose Python3. At that time, Python3 's books were really rare, and I used the Python Learning Handbook (fourth Edition). A very thick book that can be used to get started Python3. But I saw the fifth edition of the English version of the previous time, so, and so on the fifth version is also possible. The disadvantage of this book is that it is too thick, the advantage is very basic, but also too basic.
Get started this is enough, learn grammar, and use it.
On the python3 itself for Python2 language Advantage, Python3 official will give.
Then it is how to improve, the process is actually unrelated to the version.
It is recommended to do Python challenge. My python is on it, and after that, H can see the code of others, including the 3.x code. Encounter problems now on the Internet a search can find a solution. Although the domestic still more than 2.x, but Google, so on everyone asked things will be searched, basic can read.
After that, I am using Python3 in all the languages that are not restricted. Moreover, there are official documents to help you.
There are a few reasons to choose 3.
As we all know, Python version upgrade quickly, but the industry followed very slowly, when the upgrade of 2, now upgrade 3 also spent a long time, until now, can say, Pythoner really entered the py3k era. First of all, in some of the 2.x era commonly used Python libraries such as scipy, NumPy, etc. support Python3 (this is earlier), and recently, the most conservative in Python's well-known framework of Django also formally support the py3k (Django meaning I do not have to say more). Is there any reason not to migrate?
Finally, in order to solve the problem of the Python3 library, I posted a website I found: http://www. Lfd.uci.edu/~gohlke/pyt Honlibs Look at its name, and you'll know how important this is to Python3 's users.

Unofficial Windows Binaries for Python Extension Packages

It depends on what you learn to do.
If you are learning for the purpose, you can start directly from 3.3 to learn.
If used in real work or in a project, it is recommended to use it from 2.7.
After all, many 3rd-party libraries have not been followed up.
At the same time, for the textbook, it is better to use newer textbooks, because the scripting language changes are relatively large, because it is easy to evolve. Use too old textbooks, a lot of things can not keep up, it is recommended not to read the book, looking for more new. Learn Python's hard-to-get inside says, "A programmer may try to got you to install Python 3 and learn. Say, "When all of the Python code on your computer are Python 3, then I'll try to learn it." That's should keep them busy for about ten years. "

So, it's possible to learn from Python 2.6 first. I followed head first Python, starting with 3.3. In fact, many Google Baidu, or English good look at the document on the line, some small changes harmless. And the 3.x is the future mainstream. Do not recommend beginners to use python3.x, even if Python3 some things convenient, even if you need the library support 3, but you as a beginner, no programming experience, then what version popular you should use what version, now undoubtedly still python2.7.x.
Because you do not have the programming foundation, the most important goal is to learn, not to use, this is why I did not base on the first class Python high-level language after a conclusion, if you have enough time, the programming is interested, then you will be honest with the boring but the bottom of the C. In the course of learning you must read a large number of source code, it is best to the standard library, the popular third-party library source code to read, and then solve the problems in programming, and the answer to these questions, the exchange of various forums, is the most Python2.7. For those who have a programming base, or who have a python base, some traps can be seen at a glance. For the People without foundation, leading to some inexplicable errors, and then a small code to find out, do half a day can not find the reason, the original is to confuse the version. From the actual use of the point of view, I am going to use django+python3+fcgi to do a simple website, check the online information, large-scale well-known sites, such as Pinterest,disqus,instagram,bitbucket these because the development of early, should be used python2.7 or 2.6 + Django developed, but these web development itself does not seem to use a variety of python2 and 3 plug-in incompatible with the parts, or the development of these sites, the most important thing is spent in Python to write their own app, The dependence on external plugins is not big. So, this is when developing the site, a lot of the problem is about the overall architecture of the site (database, background language, cloud server), rather than the Django itself and which version of Python combined.

The links here are about the similarities and differences between Python2 and 3 Python2orpython3 , but did not give a good answer, all kinds of online problems are involved in both, but for Django should use which is not conclusive, that is to say, we have not encountered the real problem arises, so I would rather understand that python3.3 will not have any problems.
====
Add: If you want to use Django in an environment that is not self-setting, such as Bluehost shared hosting, you must use Flup to match fcgi. Unfortunately Flup is written in the python2.x version of the grammar, although in principle can change the code, so that the compilation through, but the obvious direct use of python2.7 can avoid these time costs.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.