Automate the Boring Stuff with Python

Home > Other > Automate the Boring Stuff with Python > Page 49
Automate the Boring Stuff with Python Page 49

by Al Sweigart


  concurrency issues, Passing Arguments to the Thread’s Target Function

  conditions, defined, Mixing Boolean and Comparison Operators

  continue statements, continue Statements, for Loops and the range() Function

  overview, continue Statements

  using in for loop, for Loops and the range() Function

  Coordinated Universal Time (UTC), The time Module

  coordinates, Colors and RGBA Values, Pauses and Fail-Safes

  of computer screen, Pauses and Fail-Safes

  of an image, Colors and RGBA Values

  copy() function, Passing References, Removing Whitespace with strip(), rstrip(), and lstrip(), Organizing Files, Copying and Pasting Images onto Other Images

  copytree() function, Organizing Files

  countdown project, Project: Simple Countdown Program, Project: Simple Countdown Program, Project: Simple Countdown Program, Project: Simple Countdown Program

  counting down, Project: Simple Countdown Program

  overview, Project: Simple Countdown Program

  playing sound file, Project: Simple Countdown Program

  cProfile.run() function, The time.time() Function

  crashes, program, Entering Expressions into the Interactive Shell

  create_sheet() method, Creating and Removing Sheets

  CRITICAL level, Logging Levels

  cron, Launching Other Programs from Python

  cropping images, Working with the Image Data Type

  CSS (Cascading Style Sheets), Creating a BeautifulSoup Object from HTML, Finding Elements on the Page

  matching with selenium module, Finding Elements on the Page

  selectors, Creating a BeautifulSoup Object from HTML

  CSV files, Working with CSV Files and JSON Data, Working with CSV Files and JSON Data, Reader Objects, Reading Data from Reader Objects in a for Loop, Reading Data from Reader Objects in a for Loop, The delimiter and lineterminator Keyword Arguments, The delimiter and lineterminator Keyword Arguments, The delimiter and lineterminator Keyword Arguments, The delimiter and lineterminator Keyword Arguments, Project: Removing the Header from CSV Files, Project: Removing the Header from CSV Files, Step 2: Read in the CSV File

  defined, Working with CSV Files and JSON Data

  delimeter for, The delimiter and lineterminator Keyword Arguments

  format overview, Working with CSV Files and JSON Data

  line terminator for, The delimiter and lineterminator Keyword Arguments

  Reader objects, Reader Objects

  reading data in loop, Reading Data from Reader Objects in a for Loop

  removing header from, The delimiter and lineterminator Keyword Arguments, The delimiter and lineterminator Keyword Arguments, Project: Removing the Header from CSV Files, Project: Removing the Header from CSV Files, Step 2: Read in the CSV File

  looping through CSV files, Project: Removing the Header from CSV Files

  overview, The delimiter and lineterminator Keyword Arguments

  reading in CSV file, Project: Removing the Header from CSV Files

  writing out CSV file, Step 2: Read in the CSV File

  Writer objects, Reading Data from Reader Objects in a for Loop

  curly brackets ({}), Dictionaries and Structuring Data, Matching One or More with the Plus, Matching One or More with the Plus, Matching Newlines with the Dot Character

  greedy vs. nongreedy matching, Matching One or More with the Plus

  matching specific repetitions with, Matching One or More with the Plus

  current working directory, The Current Working Directory

  D

  D character class, The findall() Method

  d character class, The findall() Method

  %d directive, Pausing Until a Specific Date

  data structures, Pretty Printing, Using Data Structures to Model Real-World Things

  algebraic chess notation, Pretty Printing

  tic-tac-toe board, Using Data Structures to Model Real-World Things

  data types, Entering Expressions into the Interactive Shell, The Integer, Floating-Point, and String Data Types, The Integer, Floating-Point, and String Data Types, The Integer, Floating-Point, and String Data Types, Flow Control, Return Values and return Statements, The List Data Type, List-like Types: Strings and Tuples, Mutable and Immutable Data Types, The Tuple Data Type, The Tuple Data Type, Dictionaries and Structuring Data

  Booleans, Flow Control

  defined, Entering Expressions into the Interactive Shell

  dictionaries, Dictionaries and Structuring Data

  floating-point numbers, The Integer, Floating-Point, and String Data Types

  integers, The Integer, Floating-Point, and String Data Types

  list() function, The Tuple Data Type

  lists, The List Data Type

  mutable vs. immutable, List-like Types: Strings and Tuples

  None value, Return Values and return Statements

  strings, The Integer, Floating-Point, and String Data Types

  tuple() function, The Tuple Data Type

  tuples, Mutable and Immutable Data Types

  datetime module, The datetime Module, The datetime Module, The datetime Module, The datetime Module, The datetime Module, The timedelta Data Type, Pausing Until a Specific Date, Pausing Until a Specific Date, Converting datetime Objects into Strings, Review of Python’s Time Functions

  arithmetic using, The timedelta Data Type

  converting objects to strings, Pausing Until a Specific Date

  converting strings to objects, Converting datetime Objects into Strings

  fromtimestamp() function, The datetime Module

  now() function, The datetime Module

  overview, The datetime Module, Review of Python’s Time Functions

  pausing program until time, Pausing Until a Specific Date

  timedelta data type, The datetime Module

  total_seconds() method, The datetime Module

  datetime objects, The datetime Module, Pausing Until a Specific Date, Converting datetime Objects into Strings

  converting to strings, Pausing Until a Specific Date

  converting from strings to, Converting datetime Objects into Strings

  debug() function, Using the logging Module

  debugging, What Is Python?, Debugging, Raising Exceptions, Assertions, Using an Assertion in a Traffic Light Simulation, Using the logging Module, Using the logging Module, Logging Levels, Disabling Logging, Disabling Logging, Over, Debugging a Number Adding Program

  assertions, Assertions

  defined, What Is Python?

  getting traceback as string, Raising Exceptions

  in IDLE, Disabling Logging, Over, Debugging a Number Adding Program

  overview, Disabling Logging

  stepping through program, Over

  using breakpoints, Debugging a Number Adding Program

  logging, Using an Assertion in a Traffic Light Simulation, Using the logging Module, Using the logging Module, Logging Levels, Disabling Logging

  disabling, Logging Levels

  to file, Disabling Logging

  levels of, Using the logging Module

  logging module, Using an Assertion in a Traffic Light Simulation

  print() function and, Using the logging Module

  raising exceptions, Debugging

  DEBUG level, Using the logging Module

  decimal numbers, The str(), int(), and float() Functions (see floating-point numbers)

  decode() method, Getting Email Addresses from a Raw Message

  decryption, of PDF files, Extracting Text from PDFs

  deduplicating code, Functions

  deepcopy() function, Passing References

  def statements, Functions, def Statements with Parameters

  with parameters, def Statements with Parameters

  DELETED search key, Performing the Search

  delete_messages() method, Getting the Body from a Raw Message

  deleting files
/folders, Moving and Renaming Files and Folders, Permanently Deleting Files and Folders

  permanently, Moving and Renaming Files and Folders

  using send2trash module, Permanently Deleting Files and Folders

  del statements, Removing Values from Lists with del Statements

  dictionaries, Passing References, Passing References, Dictionaries and Structuring Data, The Dictionary Data Type, Dictionaries vs. Lists, Dictionaries vs. Lists, Dictionaries vs. Lists, Checking Whether a Key or Value Exists in a Dictionary, Checking Whether a Key or Value Exists in a Dictionary, Checking Whether a Key or Value Exists in a Dictionary, The setdefault() Method, A Tic-Tac-Toe Board

  copy() function, Passing References

  deepcopy() function, Passing References

  get() method, Checking Whether a Key or Value Exists in a Dictionary

  in operator, Checking Whether a Key or Value Exists in a Dictionary

  items() method, Dictionaries vs. Lists

  keys() method, Dictionaries vs. Lists

  lists vs., The Dictionary Data Type

  nesting, A Tic-Tac-Toe Board

  not in operator, Checking Whether a Key or Value Exists in a Dictionary

  overview, Dictionaries and Structuring Data

  setdefault() method, The setdefault() Method

  values() method, Dictionaries vs. Lists

  directories, Reading and Writing Files, Files and File Paths, The Current Working Directory, The Current Working Directory, Absolute vs. Relative Paths, The os.path Module, The os.path Module, The os.path Module, Handling Absolute and Relative Paths, Handling Absolute and Relative Paths, Finding File Sizes and Folder Contents, Organizing Files, Copying Files and Folders, Copying Files and Folders, Moving and Renaming Files and Folders, Permanently Deleting Files and Folders, Safe Deletes with the send2trash Module

  absolute vs. relative paths, The Current Working Directory

  backslash vs. forward slash, Files and File Paths

  copying, Organizing Files

  creating, Absolute vs. Relative Paths

  current working directory, The Current Working Directory

  defined, Reading and Writing Files

  deleting permanently, Moving and Renaming Files and Folders

  deleting using send2trash module, Permanently Deleting Files and Folders

  moving, Copying Files and Folders

  os.path module, The os.path Module, The os.path Module, The os.path Module, Handling Absolute and Relative Paths, Handling Absolute and Relative Paths, Finding File Sizes and Folder Contents

  absolute paths in, The os.path Module

  file sizes, Handling Absolute and Relative Paths

  folder contents, Handling Absolute and Relative Paths

  overview, The os.path Module

  path validity, Finding File Sizes and Folder Contents

  relative paths in, The os.path Module

  renaming, Copying Files and Folders

  walking, Safe Deletes with the send2trash Module

  dirname() function, Handling Absolute and Relative Paths

  disable() function, Logging Levels

  division (/) operator, Entering Expressions into the Interactive Shell, The Multiple Assignment Trick

  Document objects, Word Documents

  dollar sign ($), Character Classes, Matching Newlines with the Dot Character

  dot character (.), The Caret and Dollar Sign Characters, The Caret and Dollar Sign Characters, The Current Working Directory

  using in paths, The Current Working Directory

  wildcard matches, The Caret and Dollar Sign Characters

  dot-star character (.*), The Wildcard Character

  doubleClick() function, Clicking the Mouse, Review of the PyAutoGUI Functions

  double quotes ("), String Literals

  double_strike attribute, Run Attributes

  downloading, Downloading Files from the Web with the requests Module, Saving Downloaded Files to the Hard Drive, Step 3: Open Web Browsers for Each Result, Project: Multithreaded XKCD Downloader

  files from web, Saving Downloaded Files to the Hard Drive

  web pages, Downloading Files from the Web with the requests Module

  XKCD comics, Step 3: Open Web Browsers for Each Result, Project: Multithreaded XKCD Downloader

  DRAFT search key, Performing the Search

  dragging mouse, Clicking the Mouse

  dragRel() function, Clicking the Mouse, Dragging the Mouse, Review of the PyAutoGUI Functions

  dragTo() function, Clicking the Mouse, Review of the PyAutoGUI Functions

  drawing on images, Ideas for Similar Programs, Ideas for Similar Programs, Ideas for Similar Programs, Lines, Lines, Lines, Lines, Drawing Example

  ellipses, Lines

  example program, Lines

  ImageDraw module, Ideas for Similar Programs

  lines, Ideas for Similar Programs

  points, Ideas for Similar Programs

  polygons, Lines

  rectangles, Lines

  text, Drawing Example

  dumps() function, Reading JSON with the loads() Function

  duration keyword arguments, Controlling Mouse Movement

  E

  ehlo() method, Connecting to an SMTP Server, Step 3: Send Customized Email Reminders

  elements, HTML, Saving Downloaded Files to the Hard Drive

  elif statements, else Statements

  ellipse() method, Lines

  else statements, if Statements

  email addresses, extracting, Combining re.IGNORECASE, re.DOTALL, and re.VERBOSE, Combining re.IGNORECASE, re.DOTALL, and re.VERBOSE, Project: Phone Number and Email Address Extractor, Step 2: Create a Regex for Email Addresses, Step 3: Find All Matches in the Clipboard Text

  creating regex, Project: Phone Number and Email Address Extractor

  finding matches on clipboard, Step 2: Create a Regex for Email Addresses

  joining matches into a string, Step 3: Find All Matches in the Clipboard Text

  overview, Combining re.IGNORECASE, re.DOTALL, and re.VERBOSE

  emails, SMTP, SMTP, Connecting to an SMTP Server, Connecting to an SMTP Server, Connecting to an SMTP Server, Connecting to an SMTP Server, Logging in to the SMTP Server, Disconnecting from the SMTP Server, Disconnecting from the SMTP Server, Disconnecting from the SMTP Server, Connecting to an IMAP Server, Connecting to an IMAP Server, Connecting to an IMAP Server, Size Limits, Size Limits, Size Limits, Fetching an Email and Marking It As Read, Getting the Body from a Raw Message, Getting the Body from a Raw Message, Disconnecting from the IMAP Server

  deleting, Getting the Body from a Raw Message

  disconnecting from server, Getting the Body from a Raw Message

  fetching, Disconnecting from the SMTP Server, Connecting to an IMAP Server, Connecting to an IMAP Server, Size Limits, Fetching an Email and Marking It As Read

  folders, Connecting to an IMAP Server

  getting message content, Size Limits

  logging into server, Connecting to an IMAP Server

  overview, Disconnecting from the SMTP Server

  raw messages, Fetching an Email and Marking It As Read

  gmail_search() method, Size Limits

  IMAP, Disconnecting from the SMTP Server

  marking message as read, Size Limits

  searching, Connecting to an IMAP Server

  sending, SMTP, Connecting to an SMTP Server, Connecting to an SMTP Server, Connecting to an SMTP Server, Connecting to an SMTP Server, Logging in to the SMTP Server, Disconnecting from the SMTP Server, Disconnecting from the IMAP Server

  connecting to SMTP server, Connecting to an SMTP Server

  disconnecting from server, Disconnecting from the SMTP Server

  logging into server, Connecting to an SMTP Server

  overview, SMTP

  reminder, Disconnecting from the IMAP Server

  sending “hello” message, Connecting to an SMTP Server

  sending message, Logging in to the SMTP Server
/>   TLS encryption, Connecting to an SMTP Server

  SMTP, SMTP

  emboss attribute, Run Attributes

  encryption, of PDF files, Overlaying Pages

  endswith() method, The isX String Methods

  epoch timestamps, The time Module, The datetime Module, Review of Python’s Time Functions

  equal to (==) operator, Boolean Values, Comparison Operators

  ERROR level, Logging Levels

  errors, Starting IDLE, Entering Expressions into the Interactive Shell

  crashes and, Entering Expressions into the Interactive Shell

  help for, Starting IDLE

  escape characters, String Literals

  evaluation, defined, Entering Expressions into the Interactive Shell

  Excel spreadsheets, Working with Excel Spreadsheets, Working with Excel Spreadsheets, Working with Excel Spreadsheets, Working with Excel Spreadsheets, Reading Excel Documents, Getting Sheets from the Workbook, Getting Sheets from the Workbook, Converting Between Column Letters and Numbers, Converting Between Column Letters and Numbers, Getting Rows and Columns from the Sheets, Project: Reading Data from a Spreadsheet, Step 1: Read the Spreadsheet Data, Step 2: Populate the Data Structure, Ideas for Similar Programs, Ideas for Similar Programs, Creating and Removing Sheets, Creating and Removing Sheets, Creating and Removing Sheets, Writing Values to Cells, Writing Values to Cells, Project: Updating a Spreadsheet, Setting the Font Style of Cells, Font Objects, Formulas, Formulas, Setting Row Height and Column Width, Merging and Unmerging Cells, Freeze Panes, Disconnecting from the IMAP Server

  application support, Working with Excel Spreadsheets

 

‹ Prev