Book description
Get up and running with Python 3.9 through concise tutorials and practical projects in this fully updated third edition
Key Features
- Extensively revised with richer examples, Python 3.9 syntax, and new chapters on APIs and packaging and distributing Python code
- Discover how to think like a Python programmer
- Learn the fundamentals of Python through real-world projects in API development, GUI programming, and data science
Book Description
Learn Python Programming, Third Edition is both a theoretical and practical introduction to Python, an extremely flexible and powerful programming language that can be applied to many disciplines. This book will make learning Python easy and give you a thorough understanding of the language. You'll learn how to write programs, build modern APIs, and work with data by using renowned Python data science libraries.
This revised edition covers the latest updates on API management, packaging applications, and testing. There is also broader coverage of context managers and an updated data science chapter.
The book empowers you to take ownership of writing your software and become independent in fetching the resources you need. You will have a clear idea of where to go and how to build on what you have learned from the book.
Through examples, the book explores a wide range of applications and concludes by building real-world Python projects based on the concepts you have learned.
What you will learn
- Get Python up and running on Windows, Mac, and Linux
- Write elegant, reusable, and efficient code in any situation
- Avoid common pitfalls like duplication, complicated design, and over-engineering
- Understand when to use the functional or object-oriented approach to programming
- Build a simple API with FastAPI and program GUI applications with Tkinter
- Get an initial overview of more complex topics such as data persistence and cryptography
- Fetch, clean, and manipulate data, making efficient use of Python's built-in data structures
Who this book is for
This book is for everyone who wants to learn Python from scratch, as well as experienced programmers looking for a reference book. Prior knowledge of basic programming concepts will help you follow along, but it's not a prerequisite.
Table of contents
- Preface
-
A Gentle Introduction to Python
- A proper introduction
- Enter the Python
- About Python
- What are the drawbacks?
- Who is using Python today?
- Setting up the environment
- Installing Python
- How to run a Python program
- How is Python code organized?
- Python's execution model
- Guidelines for writing good code
- Python culture
- A note on IDEs
- Summary
- Built-In Data Types
- Conditionals and Iteration
-
Functions, the Building Blocks of Code
- Why use functions?
- Scopes and name resolution
- Input parameters
- Return values
- A few useful tips
- Recursive functions
- Anonymous functions
- Function attributes
- Built-in functions
- Documenting your code
- Importing objects
- One final example
- Summary
- Comprehensions and Generators
-
OOP, Decorators, and Iterators
- Decorators
-
Object-oriented programming (OOP)
- The simplest Python class
- Class and object namespaces
- Attribute shadowing
- The self argument
- Initializing an instance
- OOP is about code reuse
- Accessing a base class
- Multiple inheritance
- Class and static methods
- Private methods and name mangling
- The property decorator
- The cached_property decorator
- Operator overloading
- Polymorphism – a brief overview
- Data classes
- Writing a custom iterator
- Summary
- Exceptions and Context Managers
-
Files and Data Persistence
- Working with files and directories
- Data interchange formats
- I/O, streams, and requests
- Persisting data on disk
- Summary
- Cryptography and Tokens
- Testing
- Debugging and Profiling
- GUIs and Scripting
- Data Science in Brief
- Introduction to API Development
- Packaging Python Applications
- Other Books You May Enjoy
- Index
Product information
- Title: Learn Python Programming - Third Edition
- Author(s):
- Release date: October 2021
- Publisher(s): Packt Publishing
- ISBN: 9781801815093
You might also like
book
Learning Python, 5th Edition
Get a comprehensive, in-depth introduction to the core Python language with this hands-on book. Based on …
book
Introducing Python, 2nd Edition
Easy to understand and fun to read, this updated edition of Introducing Python is ideal for …
book
Expert Python Programming - Fourth Edition
Gain a deep understanding of building, maintaining, packaging, and shipping robust Python applications Key Features Discover …
book
Head First Python, 3rd Edition
What will you learn from this book? Want to learn the Python language without slogging your …