Book recommended Python programming: From Getting started to practicing (HD full pdf)

Source: Internet
Author: User
Tags delete key sublime text using git virtual environment heroku toolbelt

This book I read the electronic version, feel good, a total of 20 chapters, the book is as follows:

This book is designed to enable you to learn Python as quickly as possible so that you can write programs that work correctly-games, data visualizations, and WEB applications-while mastering basic programming knowledge that will benefit you for life. This book is suitable for readers of any age to read,
It does not require you to have any Python programming experience or even require you to have programming experience. If you want to quickly master the basics of programming to focus on developing projects of interest, and want to examine your learning concepts by solving meaningful problems
Understanding, the book is written for you. This book is also available for junior and high school teachers to introduce programming to students through development projects.

This book is designed to make you a good programmer, specifically, a good Python programmer. By reading this book, you will quickly master programming concepts, lay a solid foundation, and develop good habits. After reading this book, you can start
Learn Python advanced technology and make it easier to master other programming languages.
In the first part of this book, you'll learn the basic programming concepts you need to be familiar with when writing Python programs, and you'll need to learn these concepts when you're just touching almost any programming language. You will learn a variety of data and store the data in the program into a list
And the way in the dictionary. You will learn how to create data collections and how to traverse them efficiently. You will learn to use the while and if statements to examine the condition and execute part of the code when the condition is met, while the condition is not satisfied
The other part of the execution code-this can be very helpful for automating the process.
You will learn to get user input, allow the program to interact with the user, and stay running when the user does not stop typing. You'll explore how to write functions to make parts of your program reusable so that you write code that performs specific tasks
, you can use it as many times as you want. You will then learn to use classes to extend this concept to achieve more complex behavior, allowing very simple programs to handle a variety of situations. You will learn to write properly dealing with common mistakes
Program. After learning these basic concepts, you will be able to write short programs to solve some definite problems. Finally, you'll take the first step toward intermediate programming and learn how to write tests for your code so that you don't need to improve your program further.
Worry about the possibility of introducing bugs. The first section introduces the knowledge that allows you to develop larger, more complex projects.
In the second part, you will use the knowledge learned in the first section to develop three projects. You can complete these projects in the most appropriate order, depending on your situation, and you can choose to complete only some of them. In the first project
(In the 12th to 14th chapter), you will create a shooting game similar to the "Space Invaders". This game is called "Alien invasion" and it contains several levels of increasing difficulty. Once you have completed this project, you will be able to develop it yourself.
The game.
The second item (chapter 15th to 17th) describes the visualization of data. The goal of data scientists is to understand a vast amount of information through a variety of visualization techniques. You will use code-generated datasets, datasets that have been downloaded from the network, and programs
The data set that is automatically downloaded. After completing this project, you will be able to write programs that can filter large datasets and visualize the filtered data in a visual manner.
In the third item (chapter 18th to 20th), you will create a small Web application called "Learning Notes". This project allows users to document the concepts associated with a particular topic. You will be able to record different masters separately.
Other people to set up an account and start recording their own learning notes. You will also learn how to deploy this project so that anyone can access it through the web, regardless of where he is located.


Friends who need to learn can download PDF version of http://tadown.com/fs/ayidbe2nsbhu3e5d1/via the Web disk.
The 1th chapter starts
1.1 Building the programming environment
1.1.1 Python 2 and Python 3
1.1.2 Running Python Code Snippets
1.1.3 Hello World Program
1.2 Setting up a Python programming environment in different operating systems
1.2.1 Build Python programming environment in Linux system
1.2.2 Building a Python programming environment in OS X systems
1.2.3 Setting up a Python programming environment in Windows systems
1.3 Troubleshooting Installation Issues
1.4 Running a Python program from a terminal
1.4.1 running Python programs from the terminal in Linux and OS X systems
1.4.2 Running a Python program from a terminal in a Windows system
1.5 Summary
Chapter 2nd variables and simple data types
2.1 What happens when you run a hello_world.py
2.2 Variables
Naming and use of 2.2.1 variables
2.2.2 Avoid naming errors when using variables
2.3 String
2.3.1 using methods to modify the case of a string
2.3.2 Merging (stitching) strings
2.3.3 adding blanks using tabs or newline characters
2.3.4 Delete Blank
2.3.5 Avoid syntax errors when using strings
2.3.6 Print Statements in Python 2
2.4 Numbers
2.4.1 Integer
2.4.2 Floating Point
2.4.3 using function str () to avoid type errors
2.4.4 Integer in Python 2
2.5 notes
2.5.1 How to write comments
2.5.2 What kind of comments should be written
2.6 The Zen of Python
2.7 Summary
Introduction to the 3rd Chapter list
3.1 What is a list?
3.1.1 Accessing list elements
3.1.2 Index starting from 0 instead of 1
3.1.3 using each value in the list
3.2 Modifying, adding, and deleting elements
3.2.1 Modifying list elements
3.2.2 Adding elements to a list
3.2.3 removing elements from the list
3.3 Organization List
3.3.1 Use method Sort () to sort the list in a permanent order
3.3.2 Use function sorted () to sort a list temporarily
3.3.3 the Print List backwards
3.3.4 determining the length of a list
3.4 Avoiding Index errors when using lists
3.5 Summary
4th Operation List
4.1 Traversing the entire list
4.1.1 in-depth study of circulation
4.1.2 perform more actions in the For loop
4.1.3 perform some actions after the for loop finishes
4.2 Avoiding indentation errors
4.2.1 Forget to indent
4.2.2 Forget to indent extra lines of code
4.2.3 Unnecessary indentation
4.2.4 unnecessary indentation after the loop
4.2.5 omitted the colon
4.3 Creating a list of values
4.3.1 using function range ()
4.3.2 using range () to create a list of numbers
4.3.3 perform simple statistical calculations on a list of numbers
4.3.4 List Parsing
4.4 Using part of the list
4.4.1 Slices
4.4.2 traversing slices
4.4.3 Copy List
4.5 tuples
4.5.1 Defining tuples
4.5.2 traversing all values in a tuple
4.5.3 Modifying tuple variables
4.6 Formatting Code
4.6.1 Format Setup Guide
4.6.2 Indent
4.6.3 President
4.6.4 Empty Line
4.6.5 Other formatting guidelines
4.7 Summary
5th Chapter If statement
5.1 A simple example
5.2 Piece Test
5.2.1 Check for equality
5.2.2 Check if case is not considered equal
5.2.3 Check for unequal
5.2.4 comparison Numbers
5.2.5 checking multiple conditions
5.2.6 Check if a specific value is included in the list
5.2.7 Check if a specific value is not included in the list
5.2.8 Boolean expression
5.3 If statement
5.3.1 a simple if statement
5.3.2 If-else Statements
5.3.3 If-elif-else Structure
5.3.4 using multiple Elif code blocks
5.3.5 omitting else code blocks
5.3.6 testing Multiple conditions
5.4 Using the IF statement to process the list
5.4.1 Checking for special elements
5.4.2 Make sure the list is not empty
5.4.3 Using multiple lists
5.5 Formatting The IF statement
5.6 Summary
6th Chapter Dictionary
6.1 A simple dictionary
6.2 Using Dictionaries
6.2.1 accessing values in a dictionary
6.2.2 Adding key-value pairs
6.2.3 Create an empty dictionary first
6.2.4 modifying values in a dictionary
6.2.5 Delete key-value pairs
6.2.6 A dictionary consisting of similar objects
6.3 Traversing A dictionary
6.3.1 traversal of all key-value pairs
6.3.2 traversing all keys in a dictionary
6.3.3 all keys in the dictionary sequentially
6.3.4 traversing all values in a dictionary
6.4 Nesting
6.4.1 Dictionary List
6.4.2 storing lists in a dictionary
6.4.3 storing dictionaries in a dictionary
6.5 Summary
7th Chapter user input And while loop
7.1 How the function input () works
7.1.1 Write a clear program
7.1.2 using int () to get numeric input
7.1.3 modulo operator
7.1.4 getting input in Python 2.7
7.2 While loop introduction
7.2.1 using the While loop
7.2.2 Let the user choose when to exit
7.2.3 Use flag
7.2.4 using break to exit the loop
7.2.5 using continue in loops
7.2.6 Avoid infinite loops
7.3 Working with a while loop to work with lists and dictionaries
7.3.1 Moving elements between lists
7.3.2 Delete all list elements that contain a specific value
7.3.3 using user input to populate dictionaries
7.4 Summary
8th Chapter function
8.1 Defining functions
8.1.1 passing information to a function
8.1.2 argument and formal parameter
8.2 Passing arguments
8.2.1 positional arguments
8.2.2 keyword Arguments
8.2.3 Default Value
8.2.4 equivalent function calls
8.2.5 Avoid argument errors
8.3 return value
8.3.1 return simple values
8.3.2 make an argument optional
8.3.3 Return Dictionary
8.3.4 with functions and while loops
8.4 Delivery List
8.4.1 Modifying a list in a function
8.4.2 Prohibit function modification list
8.5 Passing any number of arguments
8.5.1 using positional arguments with any number of arguments
8.5.2 use any number of keyword arguments
8.6 Storing functions in a module
8.6.1 Importing the entire module
8.6.2 Importing a specific function
8.6.3 using as to assign aliases to functions
8.6.4 assigning aliases to modules using as
8.6.5 all functions in the import module
8.7 Guidelines for writing functions
8.8 Summary
9th Chapter Category
9.1 Creating and using classes
9.1.1 Creating a Dog class
9.1.2 to create an instance from a class
9.2 Using classes and instances
9.2.1 Car Class
9.2.2 Assigning a default value to a property
9.2.3 Modifying the value of a property
9.3 Inheritance
Methods of 9.3.1 subclasses __init__ ()
9.3.2 Inheritance in Python 2.7
9.3.3 defining properties and methods for subclasses
9.3.4 overriding methods of the parent class
9.3.5 using instances as attributes
9.3.6 Simulated physical
9.4 Importing Classes
9.4.1 Importing a single class
9.4.2 storing multiple classes in a module
9.4.3 importing multiple classes from a module
9.4.4 Importing the entire module
9.4.5 all classes in the Import module
9.4.6 importing another module in one module
9.4.7 Customizing Workflows
9.5 Python Standard Library
Class 9.6 Coding style
9.7 Summary
10th. Documents and exceptions
10.1 reading data from a file
10.1.1 reading the entire file
10.1.2 File path
10.1.3 read-by-line
10.1.4 Create a list containing the contents of each line of the file
10.1.5 using the contents of a file
10.1.6 contains 1 million-bit large files
10.1.7 pi values include your birthday?
10.2 Writing Files
10.2.1 writing an empty file
10.2.2 Writing Multiple lines
10.2.3 attaching to a file
10.3 Exceptions
10.3.1 Handling Zerodivisionerror Exceptions
10.3.2 using try-except code blocks
10.3.3 using exceptions to avoid crashes
10.3.4 Else code block
10.3.5 Handling Filenotfounderror Exceptions
10.3.6 parsing text
10.3.7 Using multiple Files
The 10.3.8 fails without a sound
10.3.9 decide which errors to report
10.4 Storing data
10.4.1 using Json.dump () and Json.load ()
10.4.2 Saving and reading user-generated data
10.4.3 Re-construction
10.5 Summary
11th Chapter Test Code
11.1 Test function
11.1.1 unit tests and test cases
11.1.2 Test to pass
11.1.3 tests that cannot be passed
What to do if the 11.1.4 test fails
11.1.5 adding new tests
11.2 Test Class
11.2.1 Various assertion methods
11.2.21 Classes to test
11.2.3 Test Anonymoussurvey Class
11.2.4 Method SetUp ()
11.3 Summary
Part II Project
Item 1 Alien Invasion
12th Chapter Armed spacecraft
12.1 Planning Projects
12.2 Installing Pygame
12.2.1 using PIP to install Python packages
12.2.2 installing Pygame on Linux systems
12.2.3 installing Pygame in OS X systems
12.2.4 installing Pygame in Windows systems
12.3 Starting the game project
12.3.1 creating Pygame windows and responding to user input
12.3.2 Setting the background color
12.3.3 Creating a settings class
12.4 Adding a spaceship image
12.4.1 Creating a ship class
12.4.2 to draw a spaceship on the screen
12.5 Refactoring: Module game_functions
12.5.1 function check_events ()
12.5.2 function Update_screen ()
12.6 driving a spaceship
12.6.1 Response button
12.6.2 allows constant movement
12.6.3 move around
12.6.4, adjust the speed of the ship.
12.6.5 limits the scope of the ship's activities
12.6.6 refactoring check_events ()
12.7 Brief review
12.7.1 alien_invasion.py
12.7.2 settings.py
12.7.3 game_functions.py
12.7.4 ship.py
12.8 shooting
12.8.1 Add bullet settings
12.8.2 Creating the Bullet class
12.8.3 storing bullets in a group
12.8.4 fire.
12.8.5 remove a missing bullet
12.8.6 Limit number of bullets
12.8.7 Create function Update_bullets ()
12.8.8 Create function Fire_bullet ()
12.9 Summary
13th Chapter Aliens
13.1 Review Items
13.2 creation of the first alien
13.2.1 Creating the Alien class
13.2.2 Creating an Alien instance
13.2.3 let aliens appear on the screen.
13.3 Creating a group of aliens
13.3.1 determine how many aliens a row can hold
13.3.2 creating multiple lines of aliens
13.3.3 Creating an alien Colony
13.3.4 refactoring Create_fleet ()
13.3.5 Adding rows
13.4 Let the alien crowd move
13.4.1 Moving the Aliens right
13.4.2 Create a setting that represents the direction of the alien movement
13.4.3 Check if aliens hit the edge of the screen.
13.4.4 moves the alien swarm down and changes the direction of movement
13.5 Shoot the Aliens.
13.5.1 detects collisions between bullets and aliens.
13.5.2 creating large bullets for testing
13.5.3 generation of new alien groups
13.5.4 increase the speed of the bullets
13.5.5 refactoring Update_bullets ()
13.6 End Game
13.6.1 detects aliens and spacecraft collisions
13.6.2 response to aliens and spacecraft collisions
13.6.3 have aliens at the bottom of the screen.
13.6.4 Game Over
13.7 Determine which parts of the game should be run
13.8 Summary
Score
14.1 Add Play button
14.1.1 Creating a Button class
14.1.2 Draw a button on the screen
14.1.3 Start the game
14.1.4 Resetting the game
14.1.5 to switch the Play button to inactive
14.1.6 Hide Cursor
14.2 Increase Level
14.2.1 Modify Speed Settings
14.2.2 Reset Speed
14.3 Scoring
14.3.1 Show Score
14.3.2 Creating a scoreboard
14.3.3 Update score When aliens are wiped out
14.3.4 the points of each alien that will be wiped into the score.
14.3.5 Increase points
14.3.6 will score round the whole
14.3.7 Highest Score
14.3.8 Display Level
14.3.9 shows the remaining number of ships
14.4 Summary
Item 2 Visualization of data
The 15th chapter generates the data
15.1 Installing Matplotlib
15.1.1 installing Matplotlib on Linux systems
15.1.2 installing matplotlib in OS X systems
15.1.3 installing matplotlib in Windows systems
15.1.4 Test Matplotlib
15.1.5 Matplotlib Gallery
15.2 Draw a simple line chart
15.2.1 modifying label text and line weights
15.2.2 Correcting graphics
15.2.3 using scatter () to draw a scatter plot and set its style
15.2.4 use Scatter () to draw a series of points
15.2.5 automatically calculate data
15.2.6 deleting outlines of data points
15.2.7 Custom Colors
15.2.8 Using color maps
15.2.9 Saving charts automatically
15.3 Random Walks
15.3.1 creating the Randomwalk () class
15.3.2 Selection Direction
15.3.3 draw a random walk chart
15.3.4 simulation multiple random Walks
15.3.5 setting the style of a random walk chart
15.3.6 Coloring Point
15.3.7 redraw start and end points
15.3.8 Hide Axes
15.3.9 Add points
15.3.10 sizing to fit the screen
15.4 using Pygal to simulate roll dice
15.4.1 installation Pygal
15.4.2 Pygal Gallery
15.4.3 Creating Die Classes
15.4.4 Roll the Dice
15.4.5 Analysis Results
15.4.6 plotting histograms
15.4.7 throw two dice at a time
15.4.8 two dice with different number of faces simultaneously
15.5 Summary
16th Chapter Download Data
16.1 CSV file format
16.1.1 parsing the CSV file header
16.1.2 Print the file header and its location
16.1.3 Extracting and reading data
16.1.4 plotting the temperature chart
16.1.5 module datetime
16.1.6 Add a date to a chart
16.1.7 covers a longer period of time
16.1.8 to draw a data series
16.1.9 to color the chart area
16.1.10 Error Checking
16.2 Making World Population map: JSON format
16.2.1 Download World Population data
16.2.2 Extract related Data
16.2.3 converting a string to a numeric value
16.2.4 get a two-letter country code
16.2.5 Making the world map
16.2.6 digital data on the world map
16.2.7 drawing a complete map of the world population
16.2.8 country groupings according to population size
16.2.9 using Pygal to set the style of the world map
16.2.10 Highlight Color Theme
16.3 Summary
The 17th chapter uses the API
17.1 using the Web API
17.1.1 Git and GitHub
17.1.2 using API calls to request data
17.1.3 Installation Requests
17.1.4 Processing API Response
17.1.5 Processing Response Dictionary
17.1.6 Overview of the most popular warehouses
17.1.7 monitoring API Rate limits
17.2 using the Pygal visualization warehouse
17.2.1 Improved Pygal chart
17.2.2 adding custom ToolTips
17.2.3 drawing based on data
17.2.4 Add a click link to a chart
17.3 Hacker News API
17.4 Summary
Project 3 WEB Application
18th. Django Introduction
18.1 Building a project
18.1.1 Develop specifications
18.1.2 setting up a virtual environment
18.1.3 installation Virtualenv
18.1.4 activating a virtual environment
18.1.5 Installing Django
18.1.6 creating a project in Django
18.1.7 Creating a Database
18.1.8 View Projects
18.2 Creating an Application
18.2.1 Defining a model
18.2.2 Activating a model
18.2.3 Django Administration Site
18.2.4 Defining a Model Entry
18.2.5 Migration Model Entry
18.2.6 registering with the Administration Website Entry
18.2.7 Django Shell
18.3 Creating a Web page: Learning Notes Home
18.3.1 Map URL
18.3.2 writing a View
18.3.3 writing a template
18.4 Creating additional pages
18.4.1 Template Inheritance
18.4.2 Show pages for all topics
18.4.3 Show pages for a specific topic
18.5 Summary
19th Chapter User Account
19.1 allow users to enter data
19.1.1 Adding a new theme
19.1.2 Adding a new entry
19.1.3 Edit Entry
19.2 Creating a user account
19.2.1 Applications Users
19.2.2 Login Page
19.2.3 logoff
19.2.4 Registration page
19.3 Let the user have their own data
19.3.1 restricting access using @login_required
19.3.2 associating data to users
19.3.3 only allows users to access their own themes
19.3.4 protecting the user's theme
19.3.5 Protection Page Edit_entry
19.3.6 associating a new theme to the current user
19.4 Summary
20th. Set the style of the application and deploy it
20.1 Setting the style of the project "Learning notes"
20.1.1 Application Django-bootstrap3
20.1.2 use Bootstrap to set the style of the project "Learning notes"
20.1.3 modifying base.html
20.1.4 using Jumbotron to set the style of the home page
20.1.5 setting the style of the login page
20.1.6 setting the style of the New_topic page
20.1.7 setting the style of the topics page
20.1.8 setting the style of an entry in a topic page
20.2 deployment of "Learning notes"
20.2.1 Establish Heroku Account
20.2.2 Installing Heroku Toolbelt
20.2.3 Installing the necessary packages
20.2.4 Create a file that contains a list of packages requirements.txt
20.2.5 specifying the Python version
20.2.6 modifying settings.py for deployment to Herohu
20.2.7 creating the Procfile of the startup process
20.2.8 modifying wsgi.py for deployment to Herohu
20.2.9 creating a directory for storing static files
20.2.10 using the Gunicorn server locally
20.2.11 using Git to track project files
20.2.12 push to Heroku
20.2.13 set up a database on Heroku
20.2.14 Improved Heroku Deployment
20.2.15 to ensure project safety
20.2.16 Submit and push changes
20.2.17 Creating a custom error page
20.2.18 continues to develop
20.2.19 setting Secret_key
20.2.20 Deleting a project from Heroku
20.3 Summary
Appendix A, Installing Python
A.1 installing Python on Linux systems
a.1.1 Determining which version is installed
a.1.2 installing Python 3 on Linux systems
A.2 installing Python in OS X systems
a.2.1 determining which version is installed
a.2.2 using Homebrew to install Python 3
A.3 installing Python in Windows systems
a.3.1 installing Python 3 in a Windows system
a.3.2 Find Python Interpreter
a.3.3 adding Python to the environment variable Path
A.4 Python keyword and built-in functions
a.4.1 Python keyword
a.4.2 Python built-in functions
Appendix B Text Editor
B.1 Geany
b.1.1 installing Geany on Linux systems
b.1.2 installing Geany in Windows systems
b.1.3 running a Python program in Geany
b.1.4 Customizing the Geany settings
B.2 Sublime Text
b.2.1 installing Sublime Text in OS X systems
b.2.2 installing Sublime Text on Linux Systems
b.2.3 installing Sublime Text in a Windows system
b.2.4 running a Python program in Sublime Text
b.2.5 Configuration Sublime Text
b.2.6 Customizing the settings of the Sublime Text
B.3 IDLE
b.3.1 installing IDLE on Linux systems
b.3.2 installing IDLE in OS X systems
b.3.3 installing IDLE on Windows systems
b.3.4 Custom IDLE Settings
B.4 Emacs and Vim
Appendix C seeking Help
C.1 First Step
c.1.1, try again.
c.1.2 Rest for a while
c.1.3 Online resources for reference book
C.2 Online Search
c.2.1 Stack Overflow
c.2.2 Python Official documentation
c.2.3 Official Library Documentation
c.2.4 R/learnpython
c.2.5 Blog
C.3 IRC
c.3.1 Creating an IRC account
c.3.2 Join the Channel
c.3.3 IRC Culture
Appendix D using Git for version control
D.1 Installing Git
d.1.1 installing Git on a Linux system
d.1.2 installing Git in OS X system
d.1.3 installing Git in a Windows system
d.1.4 Configuring Git
D.2 Creating a Project
D.3 Ignoring files
D.4 Initializing the Warehouse
D.5 Check Status
D.6 adding files to the Warehouse
D.7 Execution Submission
D.8 View Commit History
D.9 Second Submission
d.10 undo Changes
d.11 Check out previous submissions
D.12 Deleting a warehouse

Book recommended Python programming: From Getting started to practicing (HD full pdf)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.