Python: Journey from Novice to Expert

Learn core concepts of Python and unleash its power to script highest quality Python programs
Preview in Mapt

Python: Journey from Novice to Expert

Fabrizio Romano, Dusty Phillips, Rick van Hattem

7 customer reviews
Learn core concepts of Python and unleash its power to script highest quality Python programs

Quick links: > What will you learn?> Table of content> Product reviews

Mapt Subscription
FREE
$29.99/m after trial
eBook
$49.00
RRP $69.99
Save 29%
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$49.00
$29.99 p/m after trial
RRP $69.99
Subscription
eBook
Start 14 Day Trial

Frequently bought together


Python: Journey from Novice to Expert Book Cover
Python: Journey from Novice to Expert
$ 69.99
$ 49.00
Python GUI Programming Cookbook - Second Edition Book Cover
Python GUI Programming Cookbook - Second Edition
$ 39.99
$ 28.00
Buy 2 for $35.00
Save $74.98
Add to Cart

Book Details

ISBN 139781787120761
Paperback1311 pages

Book Description

Python is a dynamic and powerful programming language, having its application in a wide range of domains. It has an easy-to-use, simple syntax, and a powerful library, which includes hundreds of modules to provide routines for a wide range of applications, thus making it a popular language among programing enthusiasts.This course will take you on a journey from basic programming practices to high-end tools and techniques giving you an edge over your peers. It follows an interesting learning path, divided into three modules. As you complete each one, you’ll have gained key skills and get ready for the material in the next module.The first module will begin with exploring all the essentials of Python programming in an easy-to-understand way. This will lay a good foundation for those who are interested in digging deeper. It has a practical and example-oriented approach through which both the introductory and the advanced topics are explained. Starting with the fundamentals of programming and Python, it ends by exploring topics, like GUIs, web apps, and data science.In the second module you will learn about object oriented programming techniques in Python. Starting with a detailed analysis of object-oriented technique and design, you will use the Python programming language to clearly grasp key concepts from the object-oriented paradigm. This module fully explains classes, data encapsulation, inheritance, polymorphism, abstraction, and exceptions with an emphasis on when you can use each principle to develop well-designed software.With a good foundation of Python you will move onto the third module which is a comprehensive tutorial covering advanced features of the Python language. Start by creating a project-specific environment using venv. This will introduce you to various Pythonic syntax and common pitfalls before moving onto functional features and advanced concepts, thereby gaining an expert level knowledge in programming and teaching how to script highest quality Python programs.

Table of Contents

Chapter 1: Introduction and First Steps – Take a Deep Breath
A proper introduction
Enter the Python
About Python
What are the drawbacks?
Who is using Python today?
Setting up the environment
Installing Python
How you can run a Python program
How is Python code organized
Python's execution model
Guidelines on how to write good code
The Python culture
A note on the IDEs
Summary
Chapter 2: Built-in Data Types
Everything is an object
Mutable or immutable? That is the question
Numbers
Immutable sequences
Mutable sequences
Set types
Mapping types – dictionaries
The collections module
Final considerations
Summary
Chapter 3: Iterating and Making Decisions
Conditional programming
Looping
Putting this all together
A quick peek at the itertools module
Summary
Chapter 4: 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
One final example
Documenting your code
Importing objects
Summary
Chapter 5: Saving Time and Memory
map, zip, and filter
Comprehensions
Generators
Some performance considerations
Don't overdo comprehensions and generators
Name localization
Generation behavior in built-ins
One last example
Summary
Chapter 6: Advanced Concepts – OOP, Decorators, and Iterators
Decorators
Object-oriented programming
Writing a custom iterator
Summary
Chapter 7: Testing, Profiling, and Dealing with Exceptions
Testing your application
Test-driven development
Exceptions
Profiling Python
Summary
Chapter 8: The Edges – GUIs and Scripts
First approach – scripting
Second approach – a GUI application
Where do we go from here?
Summary
Chapter 9: Data Science
IPython and Jupyter notebook
Dealing with data
Where do we go from here?
Summary
Chapter 10: Web Development Done Right
What is the Web?
How does the Web work?
The Django web framework
A regex website
The future of web development
Summary
Chapter 11: Debugging and Troubleshooting
Debugging techniques
Troubleshooting guidelines
Summary
Chapter 12: Summing Up – A Complete Example
The challenge
Our implementation
Implementing the Django interface
Implementing the Falcon API
Where do you go from here?
Summary
Chapter 13: Object-oriented Design
Introducing object-oriented
Objects and classes
Specifying attributes and behaviors
Hiding details and creating the public interface
Composition
Inheritance
Case study
Exercises
Summary
Chapter 14: Objects in Python
Creating Python classes
Modules and packages
Organizing module contents
Who can access my data?
Third-party libraries
Case study
Exercises
Summary
Chapter 15: When Objects Are Alike
Basic inheritance
Multiple inheritance
Polymorphism
Abstract base classes
Case study
Exercises
Summary
Chapter 16: Expecting the Unexpected
Raising exceptions
Case study
Exercises
Summary
Chapter 17: When to Use Object-oriented Programming
Treat objects as objects
Adding behavior to class data with properties
Manager objects
Case study
Exercises
Summary
Chapter 18: Python Data Structures
Empty objects
Tuples and named tuples
Dictionaries
Lists
Sets
Extending built-ins
Queues
Case study
Exercises
Summary
Chapter 19: Python Object-oriented Shortcuts
Python built-in functions
An alternative to method overloading
Functions are objects too
Case study
Exercises
Summary
Chapter 20: Strings and Serialization
Strings
Regular expressions
Serializing objects
Case study
Exercises
Summary
Chapter 21: The Iterator Pattern
Design patterns in brief
Iterators
Comprehensions
Generators
Coroutines
Case study
Exercises
Summary
Chapter 22: Python Design Patterns I
The decorator pattern
The observer pattern
The strategy pattern
The state pattern
The singleton pattern
The template pattern
Exercises
Summary
Chapter 23: Python Design Patterns II
The adapter pattern
The facade pattern
The flyweight pattern
The command pattern
The abstract factory pattern
The composite pattern
Exercises
Summary
Chapter 24: Testing Object-oriented Programs
Why test?
Unit testing
Testing with py.test
Imitating expensive objects
How much testing is enough?
Case study
Exercises
Summary
Chapter 25: Concurrency
Threads
Multiprocessing
Futures
AsyncIO
Case study
Exercises
Summary
Chapter 26: Getting Started – One Environment per Project
Creating a virtual Python environment using venv
Bootstrapping pip using ensurepip
Installing C/C++ packages
Summary
Chapter 27: Pythonic Syntax, Common Pitfalls, and Style Guide
Code style – or what is Pythonic code?
Common pitfalls
Summary
Chapter 28: Containers and Collections – Storing Data the Right Way
Time complexity – the big O notation
Core collections
Advanced collections
Summary
Chapter 29: Functional Programming – Readability Versus Brevity
Functional programming
list comprehensions
dict comprehensions
set comprehensions
lambda functions
functools
itertools
Summary
Chapter 30: Decorators – Enabling Code Reuse by Decorating
Decorating functions
Decorating class functions
Decorating classes
Useful decorators
Summary
Chapter 31: Generators and Coroutines – Infinity, One Step at a Time
What are generators?
Coroutines
Summary
Chapter 32: Async IO – Multithreading without Threads
Introducing the asyncio library
Summary
Chapter 33: Metaclasses – Making Classes (Not Instances) Smarter
Dynamically creating classes
Abstract classes using collections.abc
Automatically registering a plugin system
Order of operations when instantiating classes
Storing class attributes in definition order
Summary
Chapter 34: Documentation – How to Use Sphinx and reStructuredText
The reStructuredText syntax
The Sphinx documentation generator
Documenting code
Summary
Chapter 35: Testing and Logging – Preparing for Bugs
Using examples as tests with doctest
Testing with py.test
Mock objects
Logging
Summary
Chapter 36: Debugging – Solving the Bugs
Non-interactive debugging
Interactive debugging
Summary
Chapter 37: Performance – Tracking and Reducing Your Memory and CPU Usage
What is performance?
Timeit – comparing code snippet performance
cProfile – finding the slowest components
Line profiler
Improving performance
Memory usage
Performance monitoring
Summary
Chapter 38: Multiprocessing – When a Single CPU Core Is Not Enough
Multithreading versus multiprocessing
Hyper-threading versus physical CPU cores
Creating a pool of workers
Sharing data between processes
Remote processes
Summary
Chapter 39: Extensions in C/C++, System Calls, and C/C++ Libraries
Introduction
Calling C/C++ with ctypes
CFFI
Native C/C++ extensions
Summary
Chapter 40: Packaging – Creating Your Own Libraries or Applications
Installing packages
Setup parameters
Packages
Entry points
Package data
Testing packages
C/C++ extensions
Wheels – the new eggs
Summary

What You Will Learn

  • Get Python up and running on Windows, Mac, and Linux in no time
  • Grasp the fundamental concepts of coding, along with the basics of data structures and control flow
  • Understand when to use the functional or the object-oriented programming approach
  • Extend class functionality using inheritance
  • Exploit object-oriented programming in key Python technologies, such as Kivy and Django
  • Understand how and when to use the functional programming paradigm
  • Use the multiprocessing library, not just locally but also across multiple machines

Authors

Table of Contents

Chapter 1: Introduction and First Steps – Take a Deep Breath
A proper introduction
Enter the Python
About Python
What are the drawbacks?
Who is using Python today?
Setting up the environment
Installing Python
How you can run a Python program
How is Python code organized
Python's execution model
Guidelines on how to write good code
The Python culture
A note on the IDEs
Summary
Chapter 2: Built-in Data Types
Everything is an object
Mutable or immutable? That is the question
Numbers
Immutable sequences
Mutable sequences
Set types
Mapping types – dictionaries
The collections module
Final considerations
Summary
Chapter 3: Iterating and Making Decisions
Conditional programming
Looping
Putting this all together
A quick peek at the itertools module
Summary
Chapter 4: 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
One final example
Documenting your code
Importing objects
Summary
Chapter 5: Saving Time and Memory
map, zip, and filter
Comprehensions
Generators
Some performance considerations
Don't overdo comprehensions and generators
Name localization
Generation behavior in built-ins
One last example
Summary
Chapter 6: Advanced Concepts – OOP, Decorators, and Iterators
Decorators
Object-oriented programming
Writing a custom iterator
Summary
Chapter 7: Testing, Profiling, and Dealing with Exceptions
Testing your application
Test-driven development
Exceptions
Profiling Python
Summary
Chapter 8: The Edges – GUIs and Scripts
First approach – scripting
Second approach – a GUI application
Where do we go from here?
Summary
Chapter 9: Data Science
IPython and Jupyter notebook
Dealing with data
Where do we go from here?
Summary
Chapter 10: Web Development Done Right
What is the Web?
How does the Web work?
The Django web framework
A regex website
The future of web development
Summary
Chapter 11: Debugging and Troubleshooting
Debugging techniques
Troubleshooting guidelines
Summary
Chapter 12: Summing Up – A Complete Example
The challenge
Our implementation
Implementing the Django interface
Implementing the Falcon API
Where do you go from here?
Summary
Chapter 13: Object-oriented Design
Introducing object-oriented
Objects and classes
Specifying attributes and behaviors
Hiding details and creating the public interface
Composition
Inheritance
Case study
Exercises
Summary
Chapter 14: Objects in Python
Creating Python classes
Modules and packages
Organizing module contents
Who can access my data?
Third-party libraries
Case study
Exercises
Summary
Chapter 15: When Objects Are Alike
Basic inheritance
Multiple inheritance
Polymorphism
Abstract base classes
Case study
Exercises
Summary
Chapter 16: Expecting the Unexpected
Raising exceptions
Case study
Exercises
Summary
Chapter 17: When to Use Object-oriented Programming
Treat objects as objects
Adding behavior to class data with properties
Manager objects
Case study
Exercises
Summary
Chapter 18: Python Data Structures
Empty objects
Tuples and named tuples
Dictionaries
Lists
Sets
Extending built-ins
Queues
Case study
Exercises
Summary
Chapter 19: Python Object-oriented Shortcuts
Python built-in functions
An alternative to method overloading
Functions are objects too
Case study
Exercises
Summary
Chapter 20: Strings and Serialization
Strings
Regular expressions
Serializing objects
Case study
Exercises
Summary
Chapter 21: The Iterator Pattern
Design patterns in brief
Iterators
Comprehensions
Generators
Coroutines
Case study
Exercises
Summary
Chapter 22: Python Design Patterns I
The decorator pattern
The observer pattern
The strategy pattern
The state pattern
The singleton pattern
The template pattern
Exercises
Summary
Chapter 23: Python Design Patterns II
The adapter pattern
The facade pattern
The flyweight pattern
The command pattern
The abstract factory pattern
The composite pattern
Exercises
Summary
Chapter 24: Testing Object-oriented Programs
Why test?
Unit testing
Testing with py.test
Imitating expensive objects
How much testing is enough?
Case study
Exercises
Summary
Chapter 25: Concurrency
Threads
Multiprocessing
Futures
AsyncIO
Case study
Exercises
Summary
Chapter 26: Getting Started – One Environment per Project
Creating a virtual Python environment using venv
Bootstrapping pip using ensurepip
Installing C/C++ packages
Summary
Chapter 27: Pythonic Syntax, Common Pitfalls, and Style Guide
Code style – or what is Pythonic code?
Common pitfalls
Summary
Chapter 28: Containers and Collections – Storing Data the Right Way
Time complexity – the big O notation
Core collections
Advanced collections
Summary
Chapter 29: Functional Programming – Readability Versus Brevity
Functional programming
list comprehensions
dict comprehensions
set comprehensions
lambda functions
functools
itertools
Summary
Chapter 30: Decorators – Enabling Code Reuse by Decorating
Decorating functions
Decorating class functions
Decorating classes
Useful decorators
Summary
Chapter 31: Generators and Coroutines – Infinity, One Step at a Time
What are generators?
Coroutines
Summary
Chapter 32: Async IO – Multithreading without Threads
Introducing the asyncio library
Summary
Chapter 33: Metaclasses – Making Classes (Not Instances) Smarter
Dynamically creating classes
Abstract classes using collections.abc
Automatically registering a plugin system
Order of operations when instantiating classes
Storing class attributes in definition order
Summary
Chapter 34: Documentation – How to Use Sphinx and reStructuredText
The reStructuredText syntax
The Sphinx documentation generator
Documenting code
Summary
Chapter 35: Testing and Logging – Preparing for Bugs
Using examples as tests with doctest
Testing with py.test
Mock objects
Logging
Summary
Chapter 36: Debugging – Solving the Bugs
Non-interactive debugging
Interactive debugging
Summary
Chapter 37: Performance – Tracking and Reducing Your Memory and CPU Usage
What is performance?
Timeit – comparing code snippet performance
cProfile – finding the slowest components
Line profiler
Improving performance
Memory usage
Performance monitoring
Summary
Chapter 38: Multiprocessing – When a Single CPU Core Is Not Enough
Multithreading versus multiprocessing
Hyper-threading versus physical CPU cores
Creating a pool of workers
Sharing data between processes
Remote processes
Summary
Chapter 39: Extensions in C/C++, System Calls, and C/C++ Libraries
Introduction
Calling C/C++ with ctypes
CFFI
Native C/C++ extensions
Summary
Chapter 40: Packaging – Creating Your Own Libraries or Applications
Installing packages
Setup parameters
Packages
Entry points
Package data
Testing packages
C/C++ extensions
Wheels – the new eggs
Summary

Book Details

ISBN 139781787120761
Paperback1311 pages
Read More
From 7 reviews

Read More Reviews

Recommended for You

Python GUI Programming Cookbook - Second Edition Book Cover
Python GUI Programming Cookbook - Second Edition
$ 39.99
$ 28.00
Python: End-to-end Data Analysis Book Cover
Python: End-to-end Data Analysis
$ 71.99
$ 50.40
Learn Python in 7 Days Book Cover
Learn Python in 7 Days
$ 31.99
$ 22.40
The Python Apprentice Book Cover
The Python Apprentice
$ 31.99
$ 22.40
Python: Real World Machine Learning Book Cover
Python: Real World Machine Learning
$ 71.99
$ 50.40
Modern OpenGL C++ 3D Game Tutorial Series & 3D Rendering [Video] Book Cover
Modern OpenGL C++ 3D Game Tutorial Series & 3D Rendering [Video]
$ 49.99
$ 42.50