Python All-in-One For Dummies

Book description

Your one-stop resource on all things Python

Thanks to its flexibility, Python has grown to become one of the most popular programming languages in the world. Developers use Python in app development, web development, data science, machine learning, and even in coding education classes.

There's almost no type of project that Python can't make better. From creating apps to building complex websites to sorting big data, Python provides a way to get the work done. Python All-in-One For Dummies offers a starting point for those new to coding by explaining the basics of Python and demonstrating how it’s used in a variety of applications.

  • Covers the basics of the language
  • Explains its syntax through application in high-profile industries
  • Shows how Python can be applied to projects in enterprise
  • Delves into major undertakings including artificial intelligence, physical computing, machine learning, robotics and data analysis

This book is perfect for anyone new to coding as well as experienced coders interested in adding Python to their toolbox.

Table of contents

  1. Cover
  2. Introduction
    1. About This Book
    2. Foolish Assumptions
    3. Icons Used in This Book
    4. Beyond the Book
    5. Where to Go from Here
  3. Book 1: Getting Started with Python
    1. Chapter 1: Starting with Python
      1. Why Python Is Hot
      2. Choosing the Right Python
      3. Tools for Success
      4. Writing Python in VS Code
      5. Using Jupyter Notebook for Coding
    2. Chapter 2: Interactive Mode, Getting Help, Writing Apps
      1. Using Python Interactive Mode
      2. Creating a Python Development Workspace
      3. Creating a Folder for your Python Code
      4. Typing, Editing, and Debugging Python Code
      5. Writing Code in a Jupyter Notebook
    3. Chapter 3: Python Elements and Syntax
      1. The Zen of Python
      2. Object-Oriented Programming
      3. Indentations Count, Big Time
      4. Using Python Modules
    4. Chapter 4: Building Your First Python Application
      1. Open the Python App File
      2. Typing and Using Python Comments
      3. Understanding Python Data Types
      4. Doing Work with Python Operators
      5. Creating and Using Variables
      6. What Syntax Is and Why It Matters
      7. Putting Code Together
  4. Book 2: Understanding Python Building Blocks
    1. Chapter 1: Working with Numbers, Text, and Dates
      1. Calculating Numbers with Functions
      2. Still More Math Functions
      3. Formatting Numbers
      4. Grappling with Weirder Numbers
      5. Manipulating Strings
      6. Uncovering Dates and Times
      7. Accounting for Time Zones
      8. Working with Time Zones
    2. Chapter 2: Controlling the Action
      1. Main Operators for Controlling the Action
      2. Making Decisions with if
      3. Repeating a Process with for
      4. Looping with while
    3. Chapter 3: Speeding Along with Lists and Tuples
      1. Defining and Using Lists
      2. What's a Tuple and Who Cares?
      3. Working with Sets
    4. Chapter 4: Cruising Massive Data with Dictionaries
      1. Creating a Data Dictionary
      2. Looping through a Dictionary
      3. Data Dictionary Methods
      4. Copying a Dictionary
      5. Deleting Dictionary Items
      6. Fun with Multi-Key Dictionaries
    5. Chapter 5: Wrangling Bigger Chunks of Code
      1. Creating a Function
      2. Commenting a Function
      3. Passing Information to a Function
      4. Returning Values from Functions
      5. Unmasking Anonymous Functions
    6. Chapter 6: Doing Python with Class
      1. Mastering Classes and Objects
      2. Creating a Class
      3. How a Class Creates an Instance
      4. Giving an Object Its Attributes
      5. Giving a Class Methods
      6. Understanding Class Inheritance
    7. Chapter 7: Sidestepping Errors
      1. Understanding Exceptions
      2. Handling Errors Gracefully
      3. Being Specific about Exceptions
      4. Keeping Your App from Crashing
      5. Adding an else to the Mix
      6. Using try … except … else … finally
      7. Raising Your Own Errors
  5. Book 3: Working with Python Libraries
    1. Chapter 1: Working with External Files
      1. Understanding Text and Binary Files
      2. Opening and Closing Files
      3. Reading a File’s Contents
      4. Looping through a File
      5. Reading and Copying a Binary File
      6. Conquering CSV Files
      7. From CSV to Objects and Dictionaries
    2. Chapter 2: Juggling JSON Data
      1. Organizing JSON Data
      2. Understanding Serialization
      3. Loading Data from JSON Files
      4. Dumping Python Data to JSON
    3. Chapter 3: Interacting with the Internet
      1. How the Web Works
      2. Opening a URL from Python
      3. Posting to the Web with Python
      4. Scraping the Web with Python
    4. Chapter 4: Libraries, Packages, and Modules
      1. Understanding the Python Standard Library
      2. Exploring Python Packages
      3. Importing Python Modules
      4. Making Your Own Modules
  6. Book 4: Using Artificial Intelligence in Python
    1. Chapter 1: Exploring Artificial Intelligence
      1. AI Is a Collection of Techniques
      2. Current Limitations of AI
    2. Chapter 2: Building a Neural Network in Python
      1. Understanding Neural Networks
      2. Building a Simple Neural Network in Python
      3. Building a Python Neural Network in TensorFlow
    3. Chapter 3: Doing Machine Learning in Python
      1. Learning by Looking for Solutions in All the Wrong Places
      2. Classifying Clothes with Machine Learning
      3. Training and Learning with TensorFlow
      4. Setting Up the Software Environment for this Chapter
      5. Creating a Machine-Learning Network for Detecting Clothes Types
      6. Visualizing with MatPlotLib
      7. Learning More Machine Learning
    4. Chapter 4: Exploring More AI in Python
      1. Limitations of the Raspberry Pi and AI
      2. Adding Hardware AI to the Raspberry Pi
      3. AI in the Cloud
      4. AI on a Graphics Card
      5. Where to Go for More AI Fun in Python
  7. Book 5: Doing Data Science with Python
    1. Chapter 1: The Five Areas of Data Science
      1. Working with Big, Big Data
      2. Cooking with Gas: The Five Step Process of Data Science
    2. Chapter 2: Exploring Big Data with Python
      1. Doing Your First Data Science Project
    3. Chapter 3: Using Big Data from the Google Cloud
      1. What Is Big Data?
      2. Understanding the Google Cloud and BigQuery
      3. Reading the Medicare Big Data
      4. Looking for the Most Polluted City in the World on an Hourly Basis
  8. Book 6: Talking to Hardware with Python
    1. Chapter 1: Introduction to Physical Computing
      1. Physical Computing Is Fun
      2. What Is a Raspberry Pi?
      3. Making Your Computer Do Things
      4. Using Small Computers to Build Projects That Do and Sense Things
      5. The Raspberry Pi: A Perfect Platform for Physical Computing in Python
      6. Controlling the LED with Python on the Raspberry Pi
      7. But Wait, There Is More …
    2. Chapter 2: No Soldering! Grove Connectors for Building Things
      1. So What Is a Grove Connector?
      2. Selecting Grove Base Units
      3. The Four Types of Grove Connectors
      4. The Four Types of Grove Signals
      5. Using Grove Cables to Get Connected
    3. Chapter 3: Sensing the World with Python: The World of I2C
      1. Understanding I2C
      2. A Fun Experiment for Measuring Oxygen and a Flame
      3. Building a Dashboard on Your Phone Using Blynk and Python
    4. Chapter 4: Making Things Move with Python
      1. Exploring Electric Motors
      2. Controlling Motors with a Computer
  9. Book 7: Building Robots with Python
    1. Chapter 1: Introduction to Robotics
      1. A Robot Is Not Always like a Human
      2. Not Every Robot Has Arms or Wheels
      3. Understanding the Main Parts of a Robot
      4. Programming Robots
    2. Chapter 2: Building Your First Python Robot
      1. Introducing the Mars Rover PiCar-B
      2. Assembling the Robot
    3. Chapter 3: Programming Your Robot Rover in Python
      1. Building a Simple High-Level Python Interface
      2. Making a Single Move with Python
      3. Functions of the RobotInterface Class
      4. Coordinating Motor Movements with Sensors
      5. Making a Python Brain for Our Robot
    4. Chapter 4: Using Artificial Intelligence in Robotics
      1. This Chapter’s Project: Going to the Dogs
      2. Setting Up the Project
      3. Machine Learning Using TensorFlow
      4. Testing the Trained Network
      5. Taking Cats and Dogs to Our Robot
      6. Other Things You Can Do with AI Techniques and the Robot
      7. AI and the Future of Robotics
  10. Index
  11. About the Author
  12. Advertisement Page
  13. Connect with Dummies
  14. End User License Agreement

Product information

  • Title: Python All-in-One For Dummies
  • Author(s): John Shovic, Alan Simpson
  • Release date: May 2019
  • Publisher(s): For Dummies
  • ISBN: 9781119557593