Leanpub Header

Skip to main content

為你自己學 Python

給新手的 Python 程式學習書

Minimum price

$15.00

$15.00

You pay

$15.00

Author earns

$12.00
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
About

About

About the Book

這是一本給新手的 Python 程式語言學習書!

本書以 Python 3 做為主要教學版本,內容涵蓋環境安裝及 Python 程式語法,包括各種常用資料型態、邏輯流程判斷、迴圈、錯誤處理、函數、模組、物件導向程式設計、檔案處理等,並透過網站爬蟲程式抓取並分析資料。

作者深入研究 Python 的 C 語言原始碼,揭開容易被忽略或誤解的細節,呈現真正的運作原理,只為給讀者提供最精準的理解。本書不僅是程式學習書,也引導您如何掌握 Python 正確的核心概念,為邁向專業奠定堅實基礎。

Share this book

Author

About the Author

高見龍

你好,我是高見龍,是一個喜歡寫程式而且希望可以寫一輩子程式的電腦阿宅。

我從 1998 年開始寫各式各樣的網站應用程式,2009 年的時候因為朋友的介紹開始接觸了開源相關的社群活動,發現這個圈子好多傻子,都無私的貢獻自己的時間跟精力在開源專案跟技術社群上,發現了新玩具就巴不得趕快跟大家分享。當年我實在搞不懂這樣做有什麼好處,所以我就加入大家,看看這些人到底在幹嘛。搞到最後,光是參加社群活動還不過癮,甚至還自己辦活動,就是想認識更多跟我一樣的傻子。

我從社群分享到開班授課已經超過 15 年,近年有寫了幾本技術書籍,比較多人知道的是為你自己學 Git 以及為你自己學 Ruby on Rails,平常也會拍影片或寫文章記錄自己的學習歷程。

https://kaochenlong.com/

Contents

Table of Contents

  • 基礎篇
    • 第 1 章:寫在最前面
      • 本書內容
      • 關於 Python
      • 關於本書
      • 調整學習方式
    • 第 2 章:環境安裝
      • 哈囉,世界!
      • 安裝 Python
      • 開發工具
      • 你的第一行程式 Hello Python
      • 安裝套件
      • 虛擬環境
    • 第 3 章:變數
      • 變數是什麼?為什麼要使用變數?
      • 常數(Constant)
      • 變數命名
      • 刪除變數
      • 使用者輸入
      • 宣告型別?
    • 第 4 章:數字與文字
      • 數字
      • 文字
      • 好用的 F 字串!
      • 索引與切片
      • 位元組
    • 第 5 章:布林值與流程控制
      • 布林值(Boolean)
      • 流程控制
      • match 比對
      • 虛無飄渺的 None
      • == 與 is
    • 第 6 章:迴圈
      • 重複的事交給迴圈做
      • for 迴圈
      • while 迴圈
      • 迴圈的控制流程
      • for 迴圈還是 while 迴圈
    • 第 7 章:串列
      • 簡介
      • 串列常見操作
      • 串列推導式
      • 串列開箱!
      • 《冷知識》Python 的陣列?
    • 第 8 章:字典
      • 簡介
      • 創建字典
      • 字典常見操作
      • 字典推導式
      • 《冷知識》什麼是「雜湊」?
    • 第 9 章:元組與集合
      • 元組
      • 集合
    • 第 10 章:函數 - 基礎篇
      • 函數是什麼?
      • 定義函數
      • 回傳值
      • 函數是一等公民
      • 作用域
      • 函數 vs 方法
    • 第 11 章:函數 - 進階篇
      • 表達式 vs 陳述句
      • Lambda 表達式
      • Closure
      • 函數裝飾器
      • 遞迴
      • 產生器
      • 偏函數與柯里化
    • 第 12 章:錯誤處理
      • 錯誤的種類
      • 錯誤 vs 例外
      • 主動丟出錯誤
      • 製作自己的錯誤類別
      • 錯誤處理
    • 第 13 章:模組與套件
      • 什麼是模組?
      • 使用模組
      • 套件與模組
    • 第 14 章:物件導向 - 基礎篇
      • 什麼是物件?
      • 類別與物件
      • 函數與方法
      • 類別方法與靜態方法
      • 繼承
      • 你是我的後代嗎?
      • 多重繼承
    • 第 15 章:物件導向 - 進階篇
      • 描述器
      • Metaclass
      • 建構子?
      • Python 的魔術方法
  • 應用篇
    • 第 16 章:檔案處理
      • 讀取檔案
      • 用完記得關!
      • 寫入檔案
    • 第 17 章:處理 CSV 檔案
      • 什麼是 CSV?
      • 讀取 CSV 檔案
      • 寫入 CSV 檔案
      • 《練習》台積電股價 K 線圖
    • 第 18 章:資料抓取與解析
      • 什麼是 API?
      • 抓取網頁資料
      • 《練習》地震資料
    • 第 19 章:偵錯工具
      • 什麼是偵錯器
      • 使用 Pdb 偵錯器
      • 常用指令整理

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub