AUTOMATING WITH PYTHON – GTIT29

Course Description

This course entitled Automation with Python will teach you how to create Python programs to:

  • Search for text in a file or across multiple files
  • Create, update, move, and rename files and folders
  • Search the Web and download online content
  • Update and format data in Excel spreadsheets of any size
  • Split, merge, watermark, and encrypt PDFs
  • Send reminder emails and text notifications
  • Fill out online forms

Course Outline

Day-1

  • Python Basics
  • Flow Control
  • Functions
  • Lists
  • Dictionaries and Structuring Data
  • Manipulating Strings

Day-2

  • Pattern Matching with Regular Expressions
  • Reading and Writing Files
  • Organizing Files
  • Debugging
  • Web Scraping

Day-3

  • Working with Excel Spreadsheets
  • Working with PDF and Word Documents
  • Working with CSV Files and JSON Data
  • Keeping Time, Scheduling Tasks, and Launching Programs

Sending Email and Text Messages

^^

Duration

3 days

^^

Target Audience

This course is designed for anyone who needs to learn how to write programs in Python. Students should have taken the Software Development for Non-Programmers course or have some experience with at least one programming language.

^^

Course Pre-requisites

  • Basic Python programming knowledge. These skills can be learned by attending our Intro to Python course.
  • Content creating, editing text files and moving between directories at a command line
  • Basic Web Browsing experience

If you have any questions or doubts as to whether you meet the pre-requisites for this course, or indeed are wondering which course best suits you, please consult with us to discuss your suitability for course attendance.

^^

Suggested Follow on Courses

There are a number of options of suitable follow-on courses, depending on your business needs. Please contact us for further details.

^^

Course Content

1. Python Basics

  • Using the Interactive shell
  • Errors are OK
  • Math Operators: (precedence high to low)
  • Brackets to control Precedence
  • Common Data Types
  • String Concatenation & Replication
  • Assignment Statements
  • Valid and Invalid variable names
  • Your First Program
  • str(), int() & float() Functions
  • Text and number equivalence

2. Flow Control

  • Flow Charts
  • Boolean Values
  • Comparison Operators
  • Operating Application
  • Binary Boolean Operators
  • Operators Evaluation
  • Code Blocks
  • Flow control if else elif
  • while loop
  • break statement
  • continue statement
  • for loops & range
  • Importing Modules
  • Sys.exit ()

>>> Workshop

3. Functions

  • def statement
  • return values
  • None value
  • Keyword Arguments and print()
  • Scope: Global can’t access local
  • Scope: local can’t use other local
  • Local and Global Variables with the Same Name
  • Exception Handling
  • try & except

>>> Workshop

4. Lists

  • List data type
  • Multi-dimensional lists
  • Sub-lists with Slices
  • Changing values with indexes
  • List Concatenation and List Replication
  • Removing Values from Lists with del
  • Working with lists
  • Using for Loops with Lists
  • in and not in Operators
  • Multiple Assignment idiom
  • Methods
  • Value in a List with the index() Method
  • append(), insert() & remove() Method
  • sort() Method
  • Exceptions in Indentation
  • tuples immutable Lists
  • tuples Conversion
  • References
  • Passing References
  • copy Module’s copy() and deepcopy()

>>> Workshop

5. Structuring Data with Dictionaries

  • Dictionary Data Type
  • keys() values() & items()
  • In the Dictionary
  • get() in Dictionaries
  • setdefault
  • Modelling the Real World
  • Tic-Tac-Toe
  • Shall we play a game ?
  • Nested Dictionaries

>>> Workshop

6. Manipulating Strings

  • String Literals
  • Comments
  • Slicing strings
  • in strings
  • Useful string functions
  • isX String
  • startswith() & endswith()
  • join() & split()
  • rjust(), ljust() & center()
  • strip() rstrip() & lstrip()
  • Project: Password Locker
  • Project: Adding Bullets to wiki Markup

>>> Workshop

7. Pattern Matching with Regular Expressions

  • Creating regex Objects
  • Multiple Matching Groups with |
  • zero or one match ?
  • zero or more match *
  • one or more +
  • Repetitions {}
  • Greedy Matches & findall
  • Character Classes
  • Matching Newlines re.DOTALL
  • Review of regex Symbols
  • Substituting Strings with the sub()

>>> Workshop

8. Reading and Writing Files

  • Path names
  • file Names
  • File Size and Folder Contents
  • Path Validity
  • Reading From Files
  • Writing to files
  • Saving Variables with Shelve
  • Pretty Printing

>>> Workshop

9. Organising Files

  • shutil Module and File Copies
  • Deletion
  • Walking the tree
  • Playing with zip files
  • Extracting from zips
  • Creating zip files

>>>Workshops

10. Debugging

  • Debugging
  • Exceptions
  • Traceback
  • Assertions
  • logging
  • Logging Levels
  • Disabling Logging
  • IDLE Debugger

>>> Workshop

11. Web Scraping

  • Web Scraping
  • webbrowser module
  • requests module
  • Missing Pages
  • Saving Pages
  • HTML
  • HTML Anchors
  • Chrome Developer Tools
  • BeautifulSoup
  • CSS Selectors
  • Finding an Element with the select() Method
  • Getting data from an Element’s Attributes
  • Controlling your browser with Selenium
  • Clicking the Page
  • Filling in Forms
  • Clicking on buttons

>>> Workshop

12. Working with Excel

  • Working with Excel
  • example.xlsx
  • Getting Sheets from the Workbook
  • Getting Cells from the Sheets
  • Getting Rows and Columns from Sheets
  • Writing Excel Documents
  • Playing with Fonts
  • Dimensions
  • Merging Cells
  • Formulas
  • Freeze panes
  • Building Charts
  • Building Charts

>>> Workshop

13. Working with PDF & word documents

  • Working with .pdf & .docx
  • Extracting Text from PDFs
  • Rotating PDFs
  • Reading Word Documents
  • Driving the styles
  • Writing Word Documents

>>> Workshop

14. Working with CSV and JSON

  • Working with CSV and JSON
  • Extracting Text from CSV files
  • Reader Objects in a for Loop
  • Writer Objects
  • Delimiters and line terminators
  • Reading JSON with loads()
  • Writing JSON with the dumps()
  • REST APIs and JSON
  • REST API returns

>>> Workshop

15. Keeping Time, Scheduling Task & Launching Programs

  • time Module
  • datetime Module
  • timedelta
  • datetime conversion to strings
  • strings to datetime objects
  • Threading
  • Threading

>>> Workshop

16. Sending Email & text messages

  • smtplib Module
  • imapclient Module
  • pyzmail Module
  • Seaching Email
  • twilio
  • Seaching Email

>>> Workshop

^^

See more Internet Technologies courses