Skip to Content
Python实用技能学习指南
book

Python实用技能学习指南

by Posts & Telecom Press, Robert Smallshire, Austin Bingham
February 2024
Intermediate to advanced
316 pages
3h 47m
Chinese
Packt Publishing
Content preview from Python实用技能学习指南

第1章 入门

在本章中,我们将介绍如何在Windows、Ubuntu Linux和macOS系统上获取并安装Python。我们还将编写我们的第一个基本的Python代码,并熟悉主要的Python编程文化,比如Python之禅,同时还会讲解语言名称有趣的起源。

Python语言有两个主要版本,Python 2是被广泛部署的遗留版本,而现存的Python 3则是Python语言的未来。许多Python代码同时兼容最后的Python 2版本以及最新的Python 3版本。然而,Python的主要版本之间存在着一些关键的区别,严格来说它们是不兼容的。我们将在本书中使用Python 3.5,但是将指出它与Python 2的关键区别。这是一本关于Python基础知识的书,我们所提供的一切将适用于Python 3的未来版本,不要害怕尝试Python版本,因为它们都是可用的。

在开始使用Python语言进行编程之前,我们需要了解Python环境。Python是一种高度可移植的语言,它可以运行在所有主流的操作系统上。你可以在Windows、Mac或Linux上学习本书。接下来就要讲解与平台相关的主要内容——Python 3的安装,你可以自由跳过你不感兴趣的部分。

在Windows平台上安装Python 3的执行步骤如下。

(1)对于Windows系统,你需要访问Python的官方网站,并单击左侧的链接进入下载页面。然后选择其中一个MSI安装程序①[1],这具体取决你运行的是32位还是64位系统。

(2)下载并运行安装程序。

(3)在安装程序的过程中,选择是否只为自己安装Python,或者为自己机器上的所有用户安装Python。

(4)选择Python发行版的安装位置。默认安装在C:\Python35目录下。我们不建议将Python安装到Program ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
Kafka权威指南(第2版)

Kafka权威指南(第2版)

Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty

Publisher Resources

ISBN: 9781835889626