I started learning Python a few months back - and was immediately faced w/ this question. At that point I made the conscious decision to continue w/ 2.x [2.7.1 to be precise], because I was going to be involved in a project which was based on that version.
几个月前我开始学习Python - 并立即面对这个问题。那时我做出了有意识的决定继续w / 2.x [确切地说是2.7.1],因为我将参与一个基于该版本的项目。
Over time I've come across numerous occurrences of lines like "this feature will no longer be supported in 3.x", or, "this will change", or something with a similar effect. I also came to appreciate the vast repository of toolkits/libraries which allowed me to program various components. However, quite a few of these toolkits/libraries carried a disclaimer that it only supports versions < 3.x [of course, most of them were also actively working on porting to ver 3.x]
随着时间的推移,我遇到过很多次出现的行,例如“3.x中将不再支持此功能”,或者“这将改变”,或具有类似效果的某些行。我也开始欣赏大量的工具包/库,它允许我编写各种组件。但是,这些工具包/库中有相当一部分带有免责声明,它只支持<3.x版本[当然,其中大多数还积极致力于移植到版本3.x]
At this point, when i can, at best, consider myself a greenhorn - should i continue w/ 2.7 or think of moving on to 3.x? After all, it's usually best as a programmer to be aware of the latest goings-on rather than getting left behind - even if it's a matter of a single version!
在这一点上,当我能够,充其量,认为自己是一个新手 - 我应该继续w / 2.7还是想继续前进到3.x?毕竟,作为一名程序员,通常最好了解最新的事情,而不是落后 - 即使这只是一个版本的问题!
4 个解决方案
#1
5
Use python 2.7
and start python
with -3
parameter so it'll warn you when you use stuff thats not in python3 (or will be deprecated there), more details about this warnings here.
使用python 2.7并使用-3参数启动python,这样当你使用不在python3中的东西时(或将在那里弃用)它会警告你,这里有关于这个警告的更多细节。
#2
3
It's a common question and you can find a great answer on the "official wiki" : http://wiki.python.org/moin/Python2orPython3
这是一个常见的问题,您可以在“官方维基”上找到一个很好的答案:http://wiki.python.org/moin/Python2orPython3
#3
3
Continue with 2.7. This question is asked here every few months. We'll notify the world when the answer changes. :-)
继续2.7。这个问题每隔几个月就会在这里提出。当答案发生变化时,我们会通知全世界。 :-)
#4
2
When you have questions like this, it's often best to search first, read all the relevant answers, then compare all those answers to your needs. If you still have an unmet need after reading all the previous answers, you have a good question.
如果您有这样的问题,通常最好首先搜索,阅读所有相关答案,然后根据您的需求比较所有这些答案。如果您在阅读完之前的所有答案后仍然有未满足的需求,那么您有一个很好的问题。
The same is true for Python 3.1. Search for all the libraries you need. If there is some functionality you need that hasn't been ported to 3.1, you have an unmet need. If you have an unmet need, then you can ask a unique and distinct question about that specific library that wasn't (yet) ported to 3.1.
Python 3.1也是如此。搜索您需要的所有库。如果您需要一些尚未移植到3.1的功能,则需要满足需求。如果您有未满足的需求,那么您可以询问有关尚未(尚未)移植到3.1的特定库的独特且不同的问题。
This approach will always work and will never change. Ever.
这种方法永远有效,永远不会改变。永远。
-
Search the built-in libraries for something you need.
在内置库中搜索您需要的内容。
-
Search PyPI for something you need.
在PyPI中搜索您需要的东西。
If something you need is not available in 3.1, then, you have two choices.
如果3.1中没有您需要的东西,那么,您有两个选择。
-
Find someone with a similar package in Python 2 and find out what their conversion plan is. Either use their beta in Python 3 or convert it yourself to Python 3.
在Python 2中找到具有类似包的人,并找出他们的转换计划是什么。要么在Python 3中使用它们的beta,要么将它自己转换为Python 3。
-
Use Python 2 until they convert. Or use Python 2 because you can't convert the missing library.
使用Python 2直到它们转换。或者使用Python 2,因为您无法转换丢失的库。
Note that the process starts with search.
请注意,该过程从搜索开始。
#1
5
Use python 2.7
and start python
with -3
parameter so it'll warn you when you use stuff thats not in python3 (or will be deprecated there), more details about this warnings here.
使用python 2.7并使用-3参数启动python,这样当你使用不在python3中的东西时(或将在那里弃用)它会警告你,这里有关于这个警告的更多细节。
#2
3
It's a common question and you can find a great answer on the "official wiki" : http://wiki.python.org/moin/Python2orPython3
这是一个常见的问题,您可以在“官方维基”上找到一个很好的答案:http://wiki.python.org/moin/Python2orPython3
#3
3
Continue with 2.7. This question is asked here every few months. We'll notify the world when the answer changes. :-)
继续2.7。这个问题每隔几个月就会在这里提出。当答案发生变化时,我们会通知全世界。 :-)
#4
2
When you have questions like this, it's often best to search first, read all the relevant answers, then compare all those answers to your needs. If you still have an unmet need after reading all the previous answers, you have a good question.
如果您有这样的问题,通常最好首先搜索,阅读所有相关答案,然后根据您的需求比较所有这些答案。如果您在阅读完之前的所有答案后仍然有未满足的需求,那么您有一个很好的问题。
The same is true for Python 3.1. Search for all the libraries you need. If there is some functionality you need that hasn't been ported to 3.1, you have an unmet need. If you have an unmet need, then you can ask a unique and distinct question about that specific library that wasn't (yet) ported to 3.1.
Python 3.1也是如此。搜索您需要的所有库。如果您需要一些尚未移植到3.1的功能,则需要满足需求。如果您有未满足的需求,那么您可以询问有关尚未(尚未)移植到3.1的特定库的独特且不同的问题。
This approach will always work and will never change. Ever.
这种方法永远有效,永远不会改变。永远。
-
Search the built-in libraries for something you need.
在内置库中搜索您需要的内容。
-
Search PyPI for something you need.
在PyPI中搜索您需要的东西。
If something you need is not available in 3.1, then, you have two choices.
如果3.1中没有您需要的东西,那么,您有两个选择。
-
Find someone with a similar package in Python 2 and find out what their conversion plan is. Either use their beta in Python 3 or convert it yourself to Python 3.
在Python 2中找到具有类似包的人,并找出他们的转换计划是什么。要么在Python 3中使用它们的beta,要么将它自己转换为Python 3。
-
Use Python 2 until they convert. Or use Python 2 because you can't convert the missing library.
使用Python 2直到它们转换。或者使用Python 2,因为您无法转换丢失的库。
Note that the process starts with search.
请注意,该过程从搜索开始。