开发者社区> 方倍工作室> 正文

简明Python3教程 首页

简介: A Byte of Python 'A Byte of Python' is a free book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience.

A Byte of Python

'A Byte of Python' is a free book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you.

This book is written for the latest Python 3, even though Python 2 is the commonly found version of Python today (read more about it in Python 2 versus 3 section).

Who Reads A Byte of Python?

Here are what people are saying about the book:

The best thing i found was "A Byte of Python", which is simply a brilliant book for a beginner. It's well written, the concepts are well explained with self evident examples.

-- Syed Talal (19 years old)

This is the best beginner's tutorial I've ever seen! Thank you for your effort.

-- Walt Michalik (wmich50-at-theramp-dot-net)

You've made the best Python tutorial I've found on the Net. Great work. Thanks!

-- Joshua Robin (joshrob-at-poczta-dot-onet-dot-pl)

Excellent gentle introduction to programming #Python for beginners

-- Shan Rajasekaran

Hi, I'm from Dominican Republic. My name is Pavel, recently I read your book 'A Byte of Python' and I consider it excellent!! :). I learnt much from all the examples. Your book is of great help for newbies like me...

-- Pavel Simo (pavel-dot-simo-at-gmail-dot-com)

I recently finished reading Byte of Python, and I thought I really ought to thank you. I was very sad to reach the final pages as I now have to go back to dull, tedious oreilly or etc. manuals for learning about python. Anyway, I really appreciate your book.

-- Samuel Young (sy-one-three-seven-at-gmail-dot-com)

Dear Swaroop, I am taking a class from an instructor that has no interest in teaching. We are using Learning Python, second edition, by O'Reilly. It is not a text for beginner without any programming knowledge, and an instructor that should be working in another field. Thank you very much for your book, without it I would be clueless about Python and programming. Thanks a million, you are able to 'break the message down' to a level that beginners can understand and not everyone can.

-- Joseph Duarte (jduarte1-at-cfl-dot-rr-dot-com)

I love your book! It is the greatest Python tutorial ever, and a very useful reference. Brilliant, a true masterpiece! Keep up the good work!

-- Chris-André Sommerseth

I'm just e-mailing you to thank you for writing Byte of Python online. I had been attempting Python for a few months prior to stumbling across your book, and although I made limited success with pyGame, I never completed a program.

Thanks to your simplification of the categories, Python actually seems a reachable goal. It seems like I have finally learned the foundations and I can continue into my real goal, game development.


Once again, thanks VERY much for placing such a structured and helpful guide to basic programming on the web. It shoved me into and out of OOP with an understanding where two text books had failed.

-- Matt Gallivan (m-underscore-gallivan12-at-hotmail-dot-com)

I would like to thank you for your book 'A byte of python' which i myself find the best way to learn python. I am a 15 year old i live in egypt my name is Ahmed. Python was my second programming language i learn visual basic 6 at school but didn't enjoy it, however i really enjoyed learning python. I made the addressbook program and i was sucessful. i will try to start make more programs and read python programs (if you could tell me source that would be helpful). I will also start on learning java and if you can tell me where to find a tutorial as good as yours for java that would help me a lot. Thanx.

-- Ahmed Mohammed (sedo-underscore-91-at-hotmail-dot-com)

A wonderful resource for beginners wanting to learn more about Python is the 110-page PDF tutorial A Byte of Python by Swaroop C H. It is well-written, easy to follow, and may be the best introduction to Python programming available.

-- Drew Ames in an article on Scripting Scribus published on Linux.com

Yesterday I got through most of Byte of Python on my Nokia N800 and it's the easiest and most concise introduction to Python I have yet encountered. Highly recommended as a starting point for learning Python.

-- Jason Delport on his weblog

Byte of Vim and Python by @swaroopch is by far the best works in technical writing to me. Excellent reads #FeelGoodFactor

-- Surendran says in a tweet

"Byte of python" best one by far man

(in response to the question "Can anyone suggest a good, inexpensive resource for learning the basics of Python? ")

-- Justin LoveTrue says in a Facebook community page

"The Book Byte of python was very helpful ..Thanks bigtime :)"

-- Chinmay

Always been a fan of A Byte of Python - made for both new and experienced programmers.

-- Patrick Harrington, in a StackOverflow answer

The book is even used by NASA! It is being used in their Jet Propulsion Laboratory with their Deep Space Network project.

Academic Courses

This book is/was being used as instructional material in various educational institutions:


This book is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.

This means:

  • You are free to Share i.e. to copy, distribute and transmit this book
  • You are free to Remix i.e. to adapt this book
  • You are free to use it for commercial purposes

Please note:

  • Please do not sell electronic or printed copies of the book unless you have clearly and prominently mentioned in the description that these are not from the original author of this book.
  • Attribution must be shown in the introductory description and front page of the document by linking back to http://www.swaroopch.com/notes/Python and clearly indicating that the original text can be fetched from this location.
  • All the code/scripts provided in this book is licensed under the 3-clause BSD License unless otherwise noted.

Read Now

You can read the book online.

Buy the Book

A printed hardcopy of the book can be purchased for your offline reading pleasure, and to support the continued development and improvement of this book.


If you wish to support the continued development of this book, please consider buying a hardcopy.

Read the book in your native language

If you are interested in reading or contributing translations of this book to other human languages, please see the Translations page.






Python简明教程,此资源位于http://woodpecker.org.cn/abyteofpython_cn/chinese/ s=u'中文字符' #u表示unicode,使用u之后能正常显示中文 s='''多行文本 这是第二哈''' #'''表示多行注释。
777 0
简明Python3教程(A Byte of Python 3)
关键字:[A Byte of Python v1.92(for Python 3.0)] [A Byte of Python3] 简明Python教程 Python教程 简明Python3教程    简明Python3教程《A Byte of Python3》是一本关于用Python3语言编程的书。
2004 0
简明Python3教程 17.更多
简介 迄今为止我们已经学习了python中的大多数常用知识。本章中我们会接触到更多的知识,使得我们更全面的掌握python。   传递元组 你是否希望过从函数返回两个不同的值?做到这点使用元组即可。
1250 0
简明Python3教程 12.问题解决
我们已经探究了python语言的方方面面,现在我们将通过设计编写一个有用的程序将这些内容有机的结合起来。 主要目标是让大家有能力独自编写程序。                      问题 我们要解决的问题是”希望编写一个程序,用于创建所有重要文件的备份”。
960 0
简明Python3教程 3.介绍
介绍 Python是少有的几种既强大又简单的编程语言。你将惊喜地发现通过使用Python即可轻松专注于解决问题而非和你所用的语言格式与结构。 下面是Python的官方介绍: Python is an easy to learn, powerful programming language.
1635 0
27 0
Python GUI编程:PySide2通过加载页面设计文件的方式运行
170 0
Python 脚本速查手册