Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python Automation Cookbook
  • Table Of Contents Toc
Python Automation Cookbook

Python Automation Cookbook - Second Edition

By : Jaime Buelta
3.8 (16)
close
close
Python Automation Cookbook

Python Automation Cookbook

3.8 (16)
By: Jaime Buelta

Overview of this book

In this updated and extended version of Python Automation Cookbook, each chapter now comprises the newest recipes and is revised to align with Python 3.8 and higher. The book includes three new chapters that focus on using Python for test automation, machine learning projects, and for working with messy data. This edition will enable you to develop a sharp understanding of the fundamentals required to automate business processes through real-world tasks, such as developing your first web scraping application, analyzing information to generate spreadsheet reports with graphs, and communicating with automatically generated emails. Once you grasp the basics, you will acquire the practical knowledge to create stunning graphs and charts using Matplotlib, generate rich graphics with relevant information, automate marketing campaigns, build machine learning projects, and execute debugging techniques. By the end of this book, you will be proficient in identifying monotonous tasks and resolving process inefficiencies to produce superior and reliable systems.
Table of Contents (16 chapters)
close
close
14
Other Books You May Enjoy
15
Index

Debugging with breakpoints

Python has a built-in debugger called pdb. Stopping the execution of the code at any point is possible by setting a breakpoint. A breakpoint will jump into command-line mode. From the command line, the current status can be analyzed. Given that Python is interpreted, any new code can be executed from this stage. This is very flexible and allows you to create flexible breakpoints and change the current state to analyze the behavior of the program.

Let's see how to do it.

Getting ready

Download the debug_algorithm.py script, available from GitHub: https://github.com/PacktPublishing/Python-Automation-Cookbook-Second-Edition/blob/master/Chapter13/debug_algorithm.py.

In the next section, we will analyze the execution of the code in detail. The code checks whether numbers fulfil certain criteria:

def valid(candidate):
    if candidate <= 1:
        return False
    lower = candidate - 1
    while lower > 1:
        if candidate...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python Automation Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon