search

目前可以在网上找到的入门教程大多是针对Python2的,Python3相对于2还是有很大改动的,所以入门难度就大一些。如果我想学习Python3,需要等到我把Python2的知识学完吗,还是直接入门Python3?

回复内容:

当然是直接学3

看 learning python 吧,书里涉及 py3 的都会提出来. 目前教程大部分是基于Python2的,但其中部分教程中会指出如果代码在3中运行需要注意或改动什么。但也有部分教程是基于Python3的,例如Head First Python(中文版)。如果你想学Python3的话,如果楼主英文好的可以直接看英文版的图书或资料,学3绝对没有任何问题,如果楼主英语和答主一样很烂的话,学Python2吧,为什么呢?第一,关于2的资料多,无论是中文还是英文。第二,现在很多东西都用Python2做的,有些东西不支持3,你在应用的时候会顺手的多。第三,学完Python2转到3也是很容易的。
上述内容是基于我自己学Python将近一个月的体会,目前研究过的书有《Python基础教程》、《与小卡特一起学Python》、Head First Python(中文版),对于笨方法学Python、Python简明教程和Python快速教程等在线教程均有实践(部分由于某些原因没有完全实践。)
送上部分Python在线教程地址:
Home - 廖雪峰的官方网站
Python快速教程
简明 Python 教程 看着别人写的py2的代码,脑补自动翻译成py3。无压力
有些库例如urllib什么的合并以后再py3的doc里面写的很清楚, 谷歌一下就知道了, 根本不花精力。
python2到3已经很简单了, 你要去学C的话, 呵呵, 祝你好运。。。 Wow, 这都 2014 快要结束了也,怎么还有人问这个问题 。。。

我是 5 年前开始学 Python 3 的,以下是我在学习过程中经历过的事情:

1. 发现用来解析 xls 文件的第三方组件不支持 Py 3, 于是用 土办法,另起进程
2. 然后发现没有支持 Py 3 的数据库接口可用,仍然土办法,另起进程
3. 然后又是画图的 matplotlib 不支持 Py 3, 仍然土办法,另起进程
4. Selenium(这是个神器) 不支持?另起进程

这么一路撑下来,终于拨云见日,现在一个一个都支持了,numpy、matplotlib、oursql、Selenium ...
而我的土办法竟然有些现在还在用,一直没有改正过来 。。。

我真想给 5 年前就选择 Python 3 的自己点个赞 ~

而说到怎么入门,话说我见到的许多人,想学什么东西时的第一反应都是要找入门教程,还得是中文的。

大家真的都把 官方文档 觑如无物吗?它甚至还有一个 Tutorial

最后我想鼓励一下题主,告诉你我体会到的 Python 3 比 Python 2 最大的改进

谢谢 ~ 给你推荐一本书《The Quick Python Book, Second Edition》,在亚马逊的评价很高。
The Quick Python Book, Second Edition: Naomi R. Ceder: 9781935182207: Amazon.com: Books我正是通过这本书入手Python3的。 pythondoc.com/ Python学习手册,书里每一章节基本上同时介绍了2,3两个版本的用法。想学哪个版本就侧重着看。
m.douban.com/book/subje 如果你要玩玩的话, 3 用得更爽一些,当然想 2 你就 “2” 呗! 装 3.X 学 2.X 也没问题,报错了就百度一下。
附主要变更Python3.x和Python2.x的区别 Python 教程(官方Tutorial翻译
Python教程 - 廖雪峰的官方网站
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Python: A Deep Dive into Compilation and InterpretationPython: A Deep Dive into Compilation and InterpretationMay 12, 2025 am 12:14 AM

Pythonusesahybridmodelofcompilationandinterpretation:1)ThePythoninterpretercompilessourcecodeintoplatform-independentbytecode.2)ThePythonVirtualMachine(PVM)thenexecutesthisbytecode,balancingeaseofusewithperformance.

Is Python an interpreted or a compiled language, and why does it matter?Is Python an interpreted or a compiled language, and why does it matter?May 12, 2025 am 12:09 AM

Pythonisbothinterpretedandcompiled.1)It'scompiledtobytecodeforportabilityacrossplatforms.2)Thebytecodeistheninterpreted,allowingfordynamictypingandrapiddevelopment,thoughitmaybeslowerthanfullycompiledlanguages.

For Loop vs While Loop in Python: Key Differences ExplainedFor Loop vs While Loop in Python: Key Differences ExplainedMay 12, 2025 am 12:08 AM

Forloopsareidealwhenyouknowthenumberofiterationsinadvance,whilewhileloopsarebetterforsituationswhereyouneedtoloopuntilaconditionismet.Forloopsaremoreefficientandreadable,suitableforiteratingoversequences,whereaswhileloopsoffermorecontrolandareusefulf

For and While loops: a practical guideFor and While loops: a practical guideMay 12, 2025 am 12:07 AM

Forloopsareusedwhenthenumberofiterationsisknowninadvance,whilewhileloopsareusedwhentheiterationsdependonacondition.1)Forloopsareidealforiteratingoversequenceslikelistsorarrays.2)Whileloopsaresuitableforscenarioswheretheloopcontinuesuntilaspecificcond

Python: Is it Truly Interpreted? Debunking the MythsPython: Is it Truly Interpreted? Debunking the MythsMay 12, 2025 am 12:05 AM

Pythonisnotpurelyinterpreted;itusesahybridapproachofbytecodecompilationandruntimeinterpretation.1)Pythoncompilessourcecodeintobytecode,whichisthenexecutedbythePythonVirtualMachine(PVM).2)Thisprocessallowsforrapiddevelopmentbutcanimpactperformance,req

Python concatenate lists with same elementPython concatenate lists with same elementMay 11, 2025 am 12:08 AM

ToconcatenatelistsinPythonwiththesameelements,use:1)the operatortokeepduplicates,2)asettoremoveduplicates,or3)listcomprehensionforcontroloverduplicates,eachmethodhasdifferentperformanceandorderimplications.

Interpreted vs Compiled Languages: Python's PlaceInterpreted vs Compiled Languages: Python's PlaceMay 11, 2025 am 12:07 AM

Pythonisaninterpretedlanguage,offeringeaseofuseandflexibilitybutfacingperformancelimitationsincriticalapplications.1)InterpretedlanguageslikePythonexecuteline-by-line,allowingimmediatefeedbackandrapidprototyping.2)CompiledlanguageslikeC/C transformt

For and While loops: when do you use each in python?For and While loops: when do you use each in python?May 11, 2025 am 12:05 AM

Useforloopswhenthenumberofiterationsisknowninadvance,andwhileloopswheniterationsdependonacondition.1)Forloopsareidealforsequenceslikelistsorranges.2)Whileloopssuitscenarioswheretheloopcontinuesuntilaspecificconditionismet,usefulforuserinputsoralgorit

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Atom editor mac version download

Atom editor mac version download

The most popular open source editor