注冊(cè) | 登錄讀書好,好讀書,讀好書!
讀書網(wǎng)-DuShu.com
當(dāng)前位置: 首頁出版圖書科學(xué)技術(shù)工業(yè)技術(shù)建筑科學(xué)建筑設(shè)計(jì)Python編程之美:最佳實(shí)踐指南

Python編程之美:最佳實(shí)踐指南

Python編程之美:最佳實(shí)踐指南

定 價(jià):¥89.00

作 者: (美)肯尼思-賴茨,坦尼婭-胥盧瑟
出版社: 電子工業(yè)出版社
叢編項(xiàng):
標(biāo) 簽: 暫缺

ISBN: 9787121347573 出版時(shí)間: 2018-08-01 包裝: 平裝
開本: 16開 頁數(shù): 320 字?jǐn)?shù):  

內(nèi)容簡(jiǎn)介

  本書是Python用戶的一本百科式學(xué)習(xí)指南,由Python社區(qū)數(shù)百名成員協(xié)作奉獻(xiàn)。全書內(nèi)容分為三大部分。第一部分是關(guān)于如何配置使用Python編輯工具的;第二部分深入學(xué)習(xí)地道Python風(fēng)格的代碼范例;第三部分研究Python社區(qū)常用的一些代碼庫。本書適合有一定Python基礎(chǔ)的人員學(xué)習(xí),幫助你迅速從小工修煉成專家,編寫出高質(zhì)量的代碼!

作者簡(jiǎn)介

  Kenneth是Reitz Heroku公司的Python產(chǎn)品負(fù)責(zé)人,也是Python軟件基金會(huì)會(huì)員。他因開源了許多項(xiàng)目而知名,特別是開源項(xiàng)目Requests:HTTP for Humans。Tanya Schlusser的媽媽患有阿茲海默癥,她是主要看護(hù)人。她也是一個(gè)以數(shù)據(jù)驅(qū)動(dòng)決策的獨(dú)立顧問。她為學(xué)生和企業(yè)團(tuán)隊(duì)提供數(shù)據(jù)科學(xué)培訓(xùn),時(shí)長(zhǎng)已超過1000小時(shí)。夏永鋒 百度資深研發(fā)工程師,曾就職于騰訊,對(duì)Python、GO、JAVA開發(fā)均有較豐富的實(shí)戰(zhàn)經(jīng)驗(yàn),長(zhǎng)期從事后臺(tái)開發(fā)、大數(shù)據(jù)處理方面的工作。愛好編程和技術(shù)翻譯。

圖書目錄

前言 ........................................................................................... xix
第1 部分 起步
第1 章 選擇一個(gè)解釋器 ........................................................................ 3
Python 2 與Python 3 的狀況對(duì)比 ..........................................................................3
建議 .......................................................................................................................3
那就選擇Python 3 嗎 .............................................................................................4
Python 的不同實(shí)現(xiàn) ................................................................................................4
CPython ...........................................................................................................5
Stackless ..........................................................................................................5
PyPy ................................................................................................................5
Jython ..............................................................................................................5
IronPython .......................................................................................................6
PythonNet ........................................................................................................6
Skulpt ..............................................................................................................6
MicroPython ....................................................................................................7
第2 章 恰當(dāng)?shù)匕惭bPython ................................................................... 9
在Mac OS X 上安裝Python ..................................................................................9
Setuptools 和pip ........................................................................................... 11
virtualenv ...................................................................................................... 11

在Linux 上安裝Python .......................................................................................12
Setuptools 和pip ...........................................................................................12
開發(fā)工具 .......................................................................................................13
virtualenv ......................................................................................................14
在Windows 上安裝Python ..................................................................................15
Setuptools 和pip ...........................................................................................17
virtualenv ......................................................................................................17
商業(yè)化Python 二次發(fā)行版 ..................................................................................18
第3 章 搭建開發(fā)環(huán)境 ......................................................................... 21
文本編輯器 ..........................................................................................................21
Sublime Text ..................................................................................................22
Vim ................................................................................................................23
Emacs ............................................................................................................25
TextMate........................................................................................................26
Atom .............................................................................................................26
Code ..............................................................................................................26
IDE.......................................................................................................................27
PyCharm/IntelliJ IDEA ..................................................................................28
Aptana Studio 3/Eclipse+LiClipse+PyDev .....................................................29
WingIDE........................................................................................................29
Spyder ...........................................................................................................30
NINJA-IDE ....................................................................................................30
Komodo IDE..................................................................................................30
Eric(Eric Python IDE) .................................................................................31
Visual Studio .................................................................................................31
增強(qiáng)型交互式工具 ...............................................................................................32
IDLE .............................................................................................................32
IPython ..........................................................................................................32
bpython ..........................................................................................................33
環(huán)境隔離工具 ......................................................................................................33
虛擬環(huán)境 .......................................................................................................33
pyenv .............................................................................................................35
Autoenv .........................................................................................................36

virtualenvwrapper ..........................................................................................36
Buildout .........................................................................................................37
Conda ............................................................................................................38
Docker ...........................................................................................................39
第2 部分 步入正題
第4 章 編寫高質(zhì)量的代碼 ................................................................... 43
代碼風(fēng)格 ..............................................................................................................43
PEP 8 .............................................................................................................43
PEP 20(又名Python 之禪) ..........................................................................44
一般性建議 ...................................................................................................45
約定 ...............................................................................................................52
習(xí)語 ...............................................................................................................55
常見陷阱 .......................................................................................................58
組織好項(xiàng)目的結(jié)構(gòu) ...............................................................................................61
模塊 ...............................................................................................................61
包 ..................................................................................................................65
面向?qū)ο缶幊?................................................................................................66
裝飾器 ...........................................................................................................67
動(dòng)態(tài)類型 .......................................................................................................68
可變類型和不可變類型 .................................................................................69
管理依賴 .......................................................................................................71
測(cè)試代碼 ..............................................................................................................72
測(cè)試的基礎(chǔ)知識(shí) ............................................................................................73
舉例說明 .......................................................................................................76
其他流行工具 ................................................................................................80
文檔 .....................................................................................................................82
項(xiàng)目文檔 .......................................................................................................82
項(xiàng)目配套發(fā)行文檔 ........................................................................................83
文檔字符串與塊注釋 .....................................................................................84
日志 .....................................................................................................................84
在庫中使用logging .......................................................................................85

在應(yīng)用中使用logging ...................................................................................86
選擇許可證 ..........................................................................................................88
上游許可證 ...................................................................................................88
許可證選項(xiàng) ...................................................................................................89
軟件許可相關(guān)的學(xué)習(xí)資源 .............................................................................90
第5 章 閱讀高質(zhì)量的代碼 ................................................................... 91
共同特征 ..............................................................................................................92
HowDoI ................................................................................................................92
閱讀單文件腳本 ............................................................................................93
取自HowDoI 的結(jié)構(gòu)示例 .............................................................................96
取自HowDoI 的風(fēng)格示例 .............................................................................97
Diamond ...............................................................................................................99
閱讀一個(gè)更大的應(yīng)用程序 .............................................................................99
取自Diamond 的結(jié)構(gòu)示例 .......................................................................... 105
取自Diamond 的風(fēng)格示例 .......................................................................... 109
Tablib ................................................................................................................. 111
閱讀一個(gè)小型庫 .......................................................................................... 112
取自Tablib 的結(jié)構(gòu)示例 .............................................................................. 115
取自Tablib 的風(fēng)格示例 .............................................................................. 123
Requests ............................................................................................................. 126
閱讀一個(gè)更大的庫 ...................................................................................... 126
取自Requests 的結(jié)構(gòu)示例 .......................................................................... 130
取自Requests 的風(fēng)格示例 .......................................................................... 134
Werkzeug ........................................................................................................... 139
閱讀一個(gè)工具包的代碼 ............................................................................... 140
取自Werkzeug 的風(fēng)格示例 ......................................................................... 148
取自Werkzeug 的結(jié)構(gòu)示例 ......................................................................... 149
Flask................................................................................................................... 156
閱讀一個(gè)框架的代碼 ................................................................................... 156
取自Flask 的風(fēng)格示例 ................................................................................ 163
取自Flask 的結(jié)構(gòu)示例 ................................................................................ 164

第6 章 交付高質(zhì)量的代碼 ................................................................. 169
有用的詞匯和概念 ............................................................................................. 170
打包你的代碼 .................................................................................................... 171
Conda .......................................................................................................... 171
PyPI ............................................................................................................. 171
凍結(jié)你的代碼 .................................................................................................... 174
PyInstaller ................................................................................................... 176
cx_Freeze .................................................................................................... 178
py2app ......................................................................................................... 179
py2exe ......................................................................................................... 180
bbFreeze ...................................................................................................... 181
Linux 已構(gòu)建分發(fā)包的打包技術(shù) ........................................................................ 181
可執(zhí)行的ZIP 文件 ............................................................................................. 183
第3 部分 場(chǎng)景化指南
第7 章 用戶交互 .............................................................................. 187
Jupyter Notebooks 項(xiàng)目 ...................................................................................... 187
命令行應(yīng)用 ........................................................................................................ 188
圖形化用戶界面應(yīng)用 ......................................................................................... 196
窗口部件庫 ................................................................................................. 196
游戲開發(fā) ..................................................................................................... 202
Web 應(yīng)用 ............................................................................................................ 203
Web 框架/ 微框架 ....................................................................................... 203
Web 模板引擎 ............................................................................................. 206
Web 部署 ..................................................................................................... 212
第8 章 代碼管理和改進(jìn) .................................................................... 215
持續(xù)集成 ............................................................................................................ 215
系統(tǒng)管理 ............................................................................................................ 216
服務(wù)器自動(dòng)化 .............................................................................................. 218
系統(tǒng)和任務(wù)監(jiān)控 .......................................................................................... 222
加速 ................................................................................................................... 225

與C/C++/FORTRAN 庫進(jìn)行交互 ............................................................... 235
第9 章 軟件接口 .............................................................................. 239
Web 客戶端庫 .................................................................................................... 240
Web API ...................................................................................................... 240
數(shù)據(jù)序列化 ........................................................................................................ 245
分布式系統(tǒng) ........................................................................................................ 248
網(wǎng)絡(luò)編程 ..................................................................................................... 248
密碼技術(shù) ............................................................................................................ 254
第10 章 數(shù)據(jù)操作 ............................................................................ 261
科學(xué)應(yīng)用 ............................................................................................................ 262
文本操作和文本挖掘 ......................................................................................... 266
Python 標(biāo)準(zhǔn)庫中的字符串工具 ................................................................... 266
圖像操作 ..................................................................................................... 269
第11 章 數(shù)據(jù)持久化 ......................................................................... 273
結(jié)構(gòu)化文件 ........................................................................................................ 273
數(shù)據(jù)庫接口庫 .................................................................................................... 274
附錄A 補(bǔ)充說明 ............................................................................... 289

本目錄推薦

掃描二維碼
Copyright ? 讀書網(wǎng) ranfinancial.com 2005-2020, All Rights Reserved.
鄂ICP備15019699號(hào) 鄂公網(wǎng)安備 42010302001612號(hào)