1.
All About Strings
4 Lessons
In this chapter, you will learn how to handle Python strings, including creation, manipulation, slicing techniques, and formatting for efficient programming.
2.
Lists, Tuples and Dictionaries
4 Lessons
This chapter covers essential Python data types, such as lists, tuples, and dictionaries, which are crucial for effective programming.
3.
Conditional Statements
6 Lessons
This chapter teaches how to implement decision-making in Python using if/elif/else statements and boolean operations for flexible logic.
Learn how loops in Python enable repeated operations through for and while constructs, simplifying repetitive coding tasks with various control mechanisms.
5.
Python Comprehensions
4 Lessons
In this chapter, you will learn how Python comprehensions create lists, dictionaries, and sets efficiently, making your code cleaner and more readable.
6.
Exception Handling
5 Lessons
This chapter covers exception handling in Python, including error management, common exceptions, and effective cleanup practices.
Introduction to Exception HandlingCommon ExceptionsHow to Handle ExceptionsThe finally Statementtry, except, or else!7.
Working with Files
6 Lessons
This chapter explores file handling in Python, including reading, writing, efficient processing, error management, and best practices with the `with` operator.
Introduction to File HandlingHow to Read a FileHow To Read Files Piece by PieceWriting Files in PythonUsing the with OperatorCatching Errors in file handlingIn this chapter, you will learn how to import modules in Python, with a focus on methods and best practices for effective code management.
Importing python modulesimport thisUsing from to importImporting Everything!This chapter explores function definitions, argument handling, variable scope, and the importance of avoiding code duplication in Python programming.
FunctionsPassing Arguments to a FunctionKeyword Argumentsargs and kwargsA Note on Scope and GlobalsCoding tip: Don't repeat yourselfIn this chapter, you will learn how to use Python classes, covering their structure, instance management, and the principles of inheritance and polymorphism.
Introduction to classes in PythonCreating a ClassWhat is self?SubclassesThis chapter covers how to use Python’s introspection features, including `type`, `dir`, and `help`, for better code insight and debugging.
Introduction to IntrospectionThe Python TypeThe Python DirPython Help!In this chapter, you will learn how to use the CSV module in Python to read and write CSV files efficiently.
What's the CSV ModuleReading a CSV FileWriting a CSV FileIn this chapter, you will learn how to use Python’s `configparser` module for managing configuration files, including creation, manipulation, and interpolation.
Configuration files and config parserCreating a Config FileHow to Read, Update and Delete OptionsHow to Use InterpolationThis chapter teaches how to use Python’s logging for effective debugging, covering structured logging, multi-module support, and configuration options.
Logging in PythonCreating a Simple LoggerHow to log From Multiple Modules (and Formatting too!)Configuring Logs for Work and PleasureLearn how to use the `os` module in Python for file and directory operations, accessing platform information, and handling environmental variables.
Python's os moduleos.nameos.environ, os.getenv() and os.putenv()Directory and file functions in Pythonos.path and related functionsLearn how to send and manage emails in Python, including handling CC, BCC, and attachments for enhanced functionality.
Sending email in pythonSending Multiple Emails at OnceSend email using the TO, CC and BCC linesAdd an attachment / body using the email module17.
The SQLite Module
4 Lessons
This chapter introduces SQLite’s integration with Python, covering database creation, data manipulation, and executing basic SQL queries efficiently.
Getting started with SQLite in pythonHow to Create a Database and INSERT Some DataUpdating and Deleting RecordsBasic SQLite Queries18.
The subprocess Module
4 Lessons
Learn how the subprocess module in Python facilitates process initiation and management, supports safe execution, and communicates with external applications.
Python's subprocess moduleThe call functionThe Popen ClassLearning to Communicate with subprocessIn this chapter, you will learn to use the `sys` module for managing system parameters, command line arguments, and input/output operations in Python.
Python's sys module20.
The threading module
2 Lessons
This chapter explores Python’s threading module, focusing on thread creation and practical applications such as concurrent file downloading.
Threads in PythonWriting a Threaded Downloader21.
Working with Dates and Time
3 Lessons
In this chapter, you will learn to use Python’s `datetime` and `time` modules for date operations, formatting, and calculations.
Date and time in PythonThe datetime ModuleThe time ModuleThis chapter teaches you to use Python’s XML module, including `minidom` and `ElementTree`, for efficient XML creation, editing, and parsing.
Introduction to xml moduleWorking with minidomParsing with ElementTreeHow to Create XML with ElementTreeHow to Edit XML with ElementTreeHow to Parse XML with ElementTree23.
The Python Debugger
4 Lessons
Learn how to use the Python debugger to start sessions, step through code, and set breakpoints for efficient debugging.
Debugger module in PythonHow to Start the DebuggerStepping Through the CodeSetting breakpointsIn this chapter, you will discover how Python decorators can refine function behavior, promote cleaner code, and simplify logging and attribute handling.
Python DecoratorsA Simple FunctionCreating a Logging DecoratorBuilt-in DecoratorsReplacing Setters and Getters with a Python propertyThis chapter teaches you about lambda functions in Python and demonstrates their use in managing events with Tkinter.
Lambda statement in PythonTkinter + lambdaLearn how code profiling in Python helps identify performance issues, enabling optimizations through tools like `cProfile` and `timeit` for enhanced efficiency.
Introduction to Code ProfilingProfiling Your Code with cProfile27.
An Intro to Testing
4 Lessons
This chapter teaches you about Python’s testing tools, such as `doctest` and `unittest`, and their role in Test Driven Development for better coding practices.
doctest and unittestTesting with doctestTest Driven Development with unittestOther Notes28.
Installing Modules
5 Lessons
Learn how to install Python packages from source, use `pip` and `easy_install` methods for package installation, and manage dependencies effectively.
Introduction to Installing packagesInstalling from SourceUsing easy\_installUsing pipA Note on DependenciesThis chapter teaches how ConfigObj improves Python configuration management by supporting nested sections, validation, and dictionary-like integration.
configobj in PythonUsing a configspec30.
Parsing XML with lxml
5 Lessons
In this chapter, you will discover how to use the lxml library for XML parsing and creation in Python, focusing on its features and applications.
What are we learning in this chapter?Parsing XML with lxmlParsing the Book ExampleParsing XML with lxml.objectifyCreating XML with lxml.objectify31.
Python Code Analysis
3 Lessons
This chapter teaches you how pylint and pyflakes can be used for Python code analysis, highlighting their role in identifying errors and enhancing code quality.
pylintAnalyzing Your CodeGetting Started with pyflakes32.
The requests package
2 Lessons
This chapter explores how the requests package simplifies HTTP requests in Python, offering an easy-to-use API for managing web form submissions.
What is a 'requests' package?How to Submit a Web FormIn this chapter, you will learn how SQLAlchemy, a Python ORM, simplifies database creation, data manipulation, and querying with its powerful features.
SQLAlchemy in PythonHow to Create a DatabaseHow to Insert / Add Data to Your TablesHow to Modify Records with SQLAlchemyHow to Delete Records in SQLAlchemyThe Basic SQL Queries of SQLAlchemyIn this chapter, you will discover how Virtualenv creates isolated Python environments to manage dependencies and facilitate safe experimentation.
Virtual environmentsCreating a Virtual Environment35.
Creating Modules and Packages
3 Lessons
This chapter teaches you how to develop Python modules and packages, highlighting their structure and usability for more organized and efficient programming.
Introduction to Creating Modules & PackagesHow to Create a Python ModuleHow to Create a Python Package36.
How to Add Your Code to PyPI
4 Lessons
In this chapter, you will discover how to prepare and upload Python packages to PyPI, with a focus on setup.py and necessary configurations.
What's this chapter about?Creating a setup.py FileRegistering PackagesUploading Packages to PyPIThis chapter covers Python eggs, a legacy distribution format, and their relevance in managing existing Python packages.
Introduction to Python eggsCreating an eggThis chapter covers the Python wheel format for packaging, creation, and installation, highlighting its advantages for project management and testing.
Introduction to Python wheelCreating a wheelInstalling a Python wheelLearn how to use py2exe to convert Python applications into Windows executables, including GUI development, setup, and troubleshooting.
Introduction to py2exeCreating a Simple GUIThe py2exe setup.py fileCreating an Advanced setup.py FileThis chapter explores bbfreeze, a tool for creating standalone binaries from Python scripts supported on xWindows and Linux platforms.
bbfreeze packageGetting Started with bbfreezeUsing bbfreeze's Advanced ConfigurationThis chapter focuses on cx_Freeze, a tool for converting Python scripts into executables, covering installation, basic usage, and advanced setup techniques.
Introduction to cx_FreezeGetting Started with cx_FreezeAdvanced cx_Freeze - Using a setup.py FileIn this chapter, you will learn how PyInstaller creates standalone executables from Python scripts, ensuring compatibility across various operating systems.
Introduction to PyInstallerGetting Started with PyInstallerPyInstaller and wxPython43.
Creating an Installer
3 Lessons
In this chapter, you will discover how to create an installer in Python using GUI2Exe and Inno Setup, focusing on executable generation and packaging.
Introduction to Creating an InstallerGetting Started with GUI2ExeLet's Make an Installer!