Python Crash Course: The Ultimate Beginners Guide That Intermediate And Advanced Users Can Also Find Use In! (Python Cours Course
User Manual:
Open the PDF directly: View PDF
Page Count: 562 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- About the Author
- About the Technical Reviewer
- Brief Contents
- Contents in Detail
- Acknowledgments
- Introduction
- Part I: Basics
- Chapter 1: Getting Started
- Chapter 2: Variables and Simple Data Types
- What Really Happens When You Run hello_world.py
- Variables
- Strings
- Changing Case in a String with Methods
- Combining or Concatenating Strings
- Adding Whitespace to Strings with Tabs or Newlines
- Stripping Whitespace
- Avoiding Syntax Errors with Strings
- Printing in Python 2
- Exercise 2-3: Personal Message
- Exercise 2-4: Name Cases
- Exercise 2-5: Famous Quotes
- Exercise 2-6: Famous Quote 2
- Exercise 2-7: Stripping Names
- Numbers
- Comments
- The Zen of Python
- Summary
- Chapter 3: Introducing Lists
- Chapter 4: Working with Lists
- Looping Through an Entire List
- Avoiding Indentation Errors
- Making Numerical Lists
- Using the range() Function
- Using range() to Make a List of Numbers
- Simple Statistics with a List of Numbers
- List Comprehensions
- Exercise 4-3: Counting to Twenty
- Exercise 4-4: One Million
- Exercise 4-5: Summing a Million
- Exercise 4-6: Odd Numbers
- Exercise 4-7: Threes
- Exercise 4-8: Cubes
- Exercise 4-9: Cube Comprehension
- Working with Part of a List
- Tuples
- Styling Your Code
- Summary
- Chapter 5: if Statements
- A Simple Example
- Conditional Tests
- Checking for Equality
- Ignoring Case When Checking for Equality
- Checking for Inequality
- Numerical Comparisons
- Checking Multiple Conditions
- Checking Whether a Value Is in a List
- Checking Whether a Value Is Not in a List
- Boolean Expressions
- Exercise 5-1: Conditional Tests
- Exercise 5-2: More Conditional Tests
- if Statements
- Using if Statements with Lists
- Styling Your if Statements
- Summary
- Chapter 6: Dictionaries
- Chapter 7: User Input and while Loops
- Chapter 8: Functions
- Chapter 9: Classes
- Creating and Using a Class
- Working with Classes and Instances
- Inheritance
- The __init__() method for a Child Class
- Inheritance in Python 2.7
- Defining Attributes and Methods for the Child Class
- Overriding Methods from the Parent Class
- Instances as Attributes
- Modeling Real-World Objects
- Exercise 9-6: Ice Cream Stand
- Exercise 9-7: Admin
- Exercise 9-8: Privileges
- Exercise 9-9: Battery Upgrade
- Importing Classes
- Importing a Single Class
- Storing Multiple Classes in a Module
- Importing Multiple Classes from a Module
- Importing an Entire Module
- Importing All Classes from a Module
- Importing a Module into a Module
- Finding Your Own Workflow
- Exercise 9-10: Imported Restaurant
- Exercise 9-11: Imported Admin
- Exercise 9-12: Multiple Modules
- The Python Standard Library
- Styling Classes
- Summary
- Chapter 10: Files and Exceptions
- Reading from a File
- Writing to a File
- Exceptions
- Handling the ZeroDivisionError Exception
- Using try-except Blocks
- Using Exceptions to Prevent Crashes
- The else Block
- Handling the FileNotFoundError Exception
- Analyzing Text
- Working with Multiple Files
- Failing Silently
- Deciding Which Errors to Report
- Exercise 10-6: Addition
- Exercise 10-7: Addition Calculator
- Exercise 10-8: Cats and Dogs
- Exercise 10-9: Silent Cats and Dogs
- Exercise 10-10: Common Words
- Storing Data
- Summary
- Chapter 11: Testing Your Code
- Part II: Projects
- Project 1: Alien Invasion
- Chapter 12: A Ship that Fires Bullets
- Chapter 13: Aliens!
- Chapter 14: Scoring
- Adding the Play Button
- Leveling Up
- Scoring
- Displaying the Score
- Making a Scoreboard
- Updating the Score as Aliens Are Shot Down
- Making Sure to Score All Hits
- Increasing Point Values
- Rounding the Score
- High Scores
- Displaying the Level
- Displaying the Number of Ships
- Exercise 14-4: All-Time High Score
- Exercise 14-5: Refactoring
- Exercise 14-6: Expanding Alien Invasion
- Summary
- Project 2: Data Visualization
- Chapter 15: Generating Data
- Installing matplotlib
- Plotting a Simple Line Graph
- Changing the Label Type and Graph Thickness
- Correcting the Plot
- Plotting and Styling Individual Points with scatter()
- Plotting a Series of Points with scatter()
- Calculating Data Automatically
- Removing Outlines from Data Points
- Defining Custom Colors
- Using a Colormap
- Saving Your Plots Automatically
- Exercise 15-1: Cubes
- Exercise 15-2: Colored Cubes
- Random Walks
- Creating the RandomWalk() Class
- Choosing Directions
- Plotting the Random Walk
- Generating Multiple Random Walks
- Styling the Walk
- Coloring the Points
- Plotting the Starting and Ending Points
- Cleaning Up the Axes
- Adding Plot Points
- Altering the Size to Fill the Screen
- Exercise 15-3: Molecular Motion
- Exercise 15-4: Modified Random Walks
- Exercise 15-5: Refactoring
- Rolling Dice with Pygal
- Installing Pygal
- The Pygal Gallery
- Creating the Die Class
- Rolling the Die
- Analyzing the Results
- Making a Histogram
- Rolling Two Dice
- Rolling Dice of Different Sizes
- Exercise 15-6: Automatic Labels
- Exercise 15-7: Two D8s
- Exercise 15-8: Three Dice
- Exercise 15-9: Multiplication
- Exercise 15-10: Practicing with Both Libraries
- Summary
- Chapter 16: Downloading Data
- The CSV File Format
- Parsing the CSV File Headers
- Printing the Headers and Their Positions
- Extracting and Reading Data
- Plotting Data in a Temperature Chart
- The datetime Module
- Plotting Dates
- Plotting a Longer Timeframe
- Plotting a Second Data Series
- Shading an Area in the Chart
- Error-Checking
- Exercise 16-1: San Francisco
- Exercise 16-2: Sitka-Death Valley Comparison
- Exercise 16-3: Rainfall
- Exercise 16-4: Explore
- Mapping Global Data Sets: JSON Format
- Downloading World Population Data
- Extracting Relevant Data
- Converting Strings into Numerical Values
- Obtaining Two-Digit Country Codes
- Building a World Map
- Plotting Numerical Data on a World Map
- Plotting a Complete Population Map
- Grouping Countries by Population
- Styling World Maps in Pygal
- Lightening the Color Theme
- Exercise 16-5: All Countries
- Exercise 16-6: Gross Domestic Product
- Exercise 16-7: Choose Your Own Data
- Exercise 16-8: Testing the country_codes Module
- Summary
- The CSV File Format
- Chapter 17: Working with APIs
- Chapter 15: Generating Data
- Project 3: Web Applications
- Chapter 18: Getting Started with Django
- Chapter 19: User Accounts
- Allowing Users to Enter Data
- Setting Up User Accounts
- Allowing Users to Own Their Data
- Restricting Access with @login_required
- Connecting Data to Certain Users
- Restricting Topics Access to Appropriate Users
- Protecting a User's Topics
- Protecting the edit_entry Page
- Associating New Topics with the Current User
- Exercise 19-3: Refactoring
- Exercise 19-4: Protecting new_entry
- Exercise 19-5: Protected Blog
- Summary
- Chapter 20: Styling and Deploying an App
- Styling Learning Log
- Deploying Learning Log
- Making a Heroku Account
- Installing the Heroku Toolbelt
- Installing Required Packages
- Creating a Packages List with a requirements.txt File
- Specifying the Python Runtime
- Modifying settings.py for Heroku
- Making a Procfile to Start Processes
- Modifying wsgi.py for Heroku
- Making a Directory for Static Files
- Using the gunicorn Server Locally
- Using Git to Track the Project's Files
- Pushing to Heroku
- Setting Up the Database on Heroku
- Refining the Heroku Deployment
- Securing the Live Project
- Committing and Pushing Changes
- Creating Custom Error Pages
- Ongoing Development
- The SECRET_KEY Setting
- Deleting a Project on Heroku
- Exercise 20-3: Live Blog
- Exercise 20-4: More 404s
- Exercise 20-5: Extended Learning Log
- Summary
- Project 1: Alien Invasion
- Afterword
- Appendix A: Installing Python
- Appendix B: Text Editors
- Appendix C: Getting Help
- Appendix D: Using Git for Version Control
- Index
- Resources