Presentation Automate 1738593490906
Presentation Automate 1738593490906
Tasks
A two-day, beginner-friendly journey to streamline workflows, boost
productivity, and integrate AI into everyday tasks.
1 / 118
Goals
1. Understand the basics of Python scripting without prior
programming experience
2 / 118
Goals
1. Understand the basics of Python scripting without prior
programming experience
3 / 118
Goals
1. Understand the basics of Python scripting without prior
programming experience
3. Learn how to automate tasks such as file organization and data entry
4 / 118
Goals
1. Understand the basics of Python scripting without prior
programming experience
3. Learn how to automate tasks such as file organization and data entry
5 / 118
Why Learn to Automate?
6 / 118
Automation as a General Skill
Automate Repetitive Tasks
7 / 118
Automation as a General Skill
Automate Repetitive Tasks
Increase Productivity
8 / 118
Automation as a General Skill
Automate Repetitive Tasks
Increase Productivity
Save Money:
9 / 118
Automation as a General Skill
Automate Repetitive Tasks
Increase Productivity
Save Money:
10 / 118
The Real Reason....
11 / 118
Writing code = the most general skill you
can have!
It is a superpower! :)
12 / 118
Scripting vs. Programming
An important distinction!
13 / 118
Both are About Following Recipes
14 / 118
Scripting
Writing code to full fill a set of pre-defined steps that accomplish a task
15 / 118
Scripting
Writing code to full fill a set of pre-defined steps that accomplish a task
16 / 118
Scripting
Writing code to full fill a set of pre-defined steps that accomplish a task
17 / 118
Scripting
Writing code to full fill a set of pre-defined steps that accomplish a task
today = date.today().strftime("%Y-%m-%d")
for filename in os.listdir("."):
if filename.endswith(".txt"):
new_name = f"{today}_{filename}"
os.rename(filename, new_name)
18 / 118
Programming
At it's core is also about writing code to perform steps but...
19 / 118
Programming
At it's core is also about writing code to perform steps but...
20 / 118
Programming
At it's core is also about writing code to perform steps but...
21 / 118
Programming
At it's core is also about writing code to perform steps but...
22 / 118
This course focuses on Scripting!
23 / 118
Why focus on scripting here?
24 / 118
Why focus on scripting here?
Much faster learning curve - if it works don't change it
25 / 118
Why focus on scripting here?
Much faster learning curve - if it works don't change it
26 / 118
Why focus on scripting here?
Much faster learning curve - if it works don't change it
27 / 118
Why focus on scripting here?
Much faster learning curve - if it works don't change it
29 / 118
30 / 118
It's about Learning What We Need for Our
Tasks!
31 / 118
It's about Learning What We Need for Our
Tasks!
And purposefuly ignoring that which does not seem to have any effect on its
success.
32 / 118
Why Python?
33 / 118
Python is Easy and Everywhere
34 / 118
Python is Easy and Everywhere
Python is a general purpose language (can be used for everything)
35 / 118
Python is Easy and Everywhere
Python is a general purpose language (can be used for everything)
36 / 118
Python is Easy and Everywhere
Python is a general purpose language (can be used for everything)
Python is super easy to learn due to its proximity with natural language
37 / 118
The Busy Person Guide to Python Basics
38 / 118
Python Things We Will Learn
Basic Syntax: Indentation, variable assignments, printing
39 / 118
Python Things We Will Learn
Basic Syntax: Indentation, variable assignments, printing
40 / 118
Python Things We Will Learn
Basic Syntax: Indentation, variable assignments, printing
41 / 118
Python Things We Will Learn
Basic Syntax: Indentation, variable assignments, printing
Useful Libraries: os for file operations, csv for handling CSVs, requests
for making web requests
42 / 118
Python Things We Will Learn
Basic Syntax: Indentation, variable assignments, printing
Useful Libraries: os for file operations, csv for handling CSVs, requests
for making web requests
43 / 118
Python Things We Will Learn
Basic Syntax: Indentation, variable assignments, printing
Useful Libraries: os for file operations, csv for handling CSVs, requests
for making web requests
44 / 118
How to Use AI to Learn/Use Python
A quick detour to set up an AI toolkit to speed up our Automation skills
45 / 118
The "Just Ask AI" Naive Approach
46 / 118
The "Just Ask AI" Naive Approach
47 / 118
The "Just Ask AI" Naive Approach
48 / 118
Demo - Meta-Strategy for Scripting with AI
49 / 118
Data Types, Operations, Variables
Writing code is about writing text that changes or manipulates data in
some way
50 / 118
Data Types, Operations, Variables
Writing code is about writing text that changes or manipulates data in
some way
Data! Specifically a way to describe it, reference it, talk about it etc...
51 / 118
Data Types, Operations, Variables
Writing code is about writing text that changes or manipulates data in
some way
Data! Specifically a way to describe it, reference it, talk about it etc...
In Python data can be of different types (like numbers, text, image etc...)
52 / 118
Data Types, Operations, Variables
Writing code is about writing text that changes or manipulates data in
some way
Data! Specifically a way to describe it, reference it, talk about it etc...
In Python data can be of different types (like numbers, text, image etc...)
53 / 118
Data Types, Operations, Variables
Writing code is about writing text that changes or manipulates data in
some way
Data! Specifically a way to describe it, reference it, talk about it etc...
In Python data can be of different types (like numbers, text, image etc...)
54 / 118
Data Types, Operations, Variables - Example
Here is a piece of code that defines a variable of some type and performs
a simple operation on the data stored in the variable
# our operation
average_age_between_actual_and_mental = (actual_age + mental_age) / 2
# special function that displays what goes inside of it
print(average_age_between_actual_and_mental)
55 / 118
Data Types; Operations; Variables - Demo
56 / 118
Data Types, Operations, Variables
Core Data Types:
int: whole nubmers like 1, 2, 3 ...
float: decimal numbers like 1.1, 1.0, etc...
string: text like 'Hello'
bool: logical booleans like True or False
57 / 118
Data Types, Operations, Variables
Core Data Types:
int: whole nubmers like 1, 2, 3 ...
float: decimal numbers like 1.1, 1.0, etc...
string: text like 'Hello'
bool: logical booleans like True or False
Operations:
Arithmetic (+,-,,/,*,//,%)
String concatenation ('Lucas' + ' is' + ' wonderful' = 'Lucas is
wonderful')
Logical operations (and, or, not)
Comparison operations (>, <, >=, <=, ==, !=)
58 / 118
Data Types, Operations, Variables
Core Data Types:
int: whole nubmers like 1, 2, 3 ...
float: decimal numbers like 1.1, 1.0, etc...
string: text like 'Hello'
bool: logical booleans like True or False
Operations:
Arithmetic (+,-,,/,*,//,%)
String concatenation ('Lucas' + ' is' + ' wonderful' = 'Lucas is
wonderful')
Logical operations (and, or, not)
Comparison operations (>, <, >=, <=, ==, !=)
a = 10
b = 20
59 / 118
Functions
60 / 118
Functions
Functions are a way to group code that performs a specific task
61 / 118
Functions
Functions are a way to group code that performs a specific task
62 / 118
Functions
Functions are a way to group code that performs a specific task
For example, a function that calculates the total cost of an item including
tax
63 / 118
Functions
Functions are a way to group code that performs a specific task
For example, a function that calculates the total cost of an item including
tax
64 / 118
Functions
Functions are a way to group code that performs a specific task
For example, a function that calculates the total cost of an item including
tax
But what if I want to re-use this code for different prices and tax rates?
65 / 118
Functions
Here is what it would look like if we define a function to do this:
66 / 118
Functions
Here is what it would look like if we define a function to do this:
Now we can re-use the function for different prices and tax rates:
shirt_price = 10
shirt_tax_rate = 0.05
pants_price = 20
pants_tax_rate = 0.1
print(calculate_total(shirt_price, shirt_tax_rate))
# Output: 10.5
print(calculate_total(pants_price, pants_tax_rate))
# Output: 22.0
67 / 118
Functions
Why Functions?: Reuse code and break tasks into smaller chunks
68 / 118
Functions
Why Functions?: Reuse code and break tasks into smaller chunks
69 / 118
Functions
Why Functions?: Reuse code and break tasks into smaller chunks
70 / 118
Functions
Why Functions?: Reuse code and break tasks into smaller chunks
71 / 118
Demo Functions
72 / 118
Lists & Loops
Lists: Python’s go-to data structure for ordered collections
73 / 118
Lists & Loops
Lists: Python’s go-to data structure for ordered collections
74 / 118
Lists & Loops
Lists: Python’s go-to data structure for ordered collections
print(tasks[0])
# Output: Buy groceries
print(tasks[1])
# Output: Finish project
75 / 118
Lists & Loops
Lists: Python’s go-to data structure for ordered collections
print(tasks[0])
# Output: Buy groceries
print(tasks[1])
# Output: Finish project
76 / 118
Lists & Loops
Lists: Python’s go-to data structure for ordered collections
print(tasks[0])
# Output: Buy groceries
print(tasks[1])
# Output: Finish project
print(tasks[0:2])
# Output: ['Buy groceries', 'Finish project']
77 / 118
Lists & Loops
Loops: for loops to iterate over items
78 / 118
Lists & Loops
Loops: for loops to iterate over items
79 / 118
Lists & Loops
Loops: for loops to iterate over items
Processing List Elements: With for loops we can perform the same
operation on each element of the list
80 / 118
Lists & Loops
Loops: for loops to iterate over items
Processing List Elements: With for loops we can perform the same
operation on each element of the list
81 / 118
Lists & Loops
Loops: for loops to iterate over items
Processing List Elements: With for loops we can perform the same
operation on each element of the list
82 / 118
Demo - Lists & Loops
83 / 118
Dictionaries & Tabular Data
Dictionaries: Key-value pairs for storing related data
84 / 118
Dictionaries & Tabular Data
Dictionaries: Key-value pairs for storing related data
85 / 118
Dictionaries & Tabular Data
Dictionaries: Key-value pairs for storing related data
86 / 118
Dictionaries & Tabular Data
Dictionaries: Key-value pairs for storing related data
print(prices["apple"])
# Output: 0.50
print(prices["banana"])
# Output: 0.75
87 / 118
Dictionaries & Tabular Data
Dictionaries: Key-value pairs for storing related data
print(prices["apple"])
# Output: 0.50
print(prices["banana"])
# Output: 0.75
88 / 118
Reading/Writing
Tabular Data: Data that is organized in a table format
89 / 118
Reading/Writing
Tabular Data: Data that is organized in a table format
90 / 118
Reading/Writing
Tabular Data: Data that is organized in a table format
CSV Files store data in rows and columns via comma-separated values:
Name,Age,City
John Smith,32,New York
Jane Doe,28,San Francisco
91 / 118
Demo - Dictionaries & Tabular Data
92 / 118
Comparators & Conditionals
Boolean Comparisons: ==, !=, >, <, >=, <=
93 / 118
Comparators & Conditionals
Boolean Comparisons: ==, !=, >, <, >=, <=
94 / 118
Comparators & Conditionals
Boolean Comparisons: ==, !=, >, <, >=, <=
95 / 118
Comparators & Conditionals
Boolean Comparisons: ==, !=, >, <, >=, <=
96 / 118
Comparators & Conditionals
Conditionals: Using conditionals if/elif/else to perform different
actions based on data
97 / 118
Comparators & Conditionals
Conditionals: Using conditionals if/elif/else to perform different
actions based on data
# Example of an if statement
if a > b:
print("a is greater than b")
98 / 118
Comparators & Conditionals
Conditionals: Using conditionals if/elif/else to perform different
actions based on data
# Example of an if statement
if a > b:
print("a is greater than b")
99 / 118
Comparators & Conditionals
Conditionals: Using conditionals if/elif/else to perform different
actions based on data
# Example of an if statement
if a > b:
print("a is greater than b")
100 / 118
Demo - Working with Data
101 / 118
APIs, Packages, and AI as an API
APIs 101: Application Programming Interface—send a request, get a
response
Python Packages: Example: requests library to make HTTP calls
AI as an API: Connect to services like OpenAI or Claude for text
generation, content analysis, and more
102 / 118
The Ostrich Approach to AI Assistants
103 / 118
Automating Data Extraction
Target Websites or Documents: Identify patterns or structures (tables,
IDs, HTML tags)
Techniques: Using Beautiful Soup, Pandas, or request-response cycles
Practical Examples: Extracting data from a CSV, scraping a simple
webpage for product listings
104 / 118
Automating Basic Data Analysis
Data Loading: Reading CSV files, Excel sheets, or database tables with
Pandas
Basic Analysis: Calculating averages, sums, or finding patterns in data
Visualization: Creating simple charts or graphs to represent findings
105 / 118
Automating Slides
Effective data wrangling for high quality slides
A Hybrid Approach: AI + Python Scripts
Bulk Processing to save time
106 / 118
Automating the Browser
Tools: selenium, playwright
Common Tasks: Logging in to websites, navigating pages, clicking
buttons, scraping dynamic elements
Why Automate Browser Tasks?: Speed up online research, data entry, or
repetitive website interactions
107 / 118
Automating Filling Out Forms
Form Fields: Identifying input boxes, radio buttons, checkboxes in HTML
Scripts: Using selenium to locate elements by ID/class/xpath and input
data
Real-World Use: Automating repetitive website sign-up processes, survey
completion, or internal data-entry forms
108 / 118
AI Hacks
1. Prompt Templates: Keep a library of common prompt structures for
repetitive tasks
109 / 118
AI Hacks
1. Prompt Templates: Keep a library of common prompt structures for
repetitive tasks
110 / 118
AI Hacks
1. Prompt Templates: Keep a library of common prompt structures for
repetitive tasks
111 / 118
A System for Writing Your Scripts
Plan: Define the scope and goal of your automation
Prototype: Write a small test script or snippet to handle one core task
Expand: Add new features or handle edge cases incrementally
Refine: Use AI assistance to improve structure, fix bugs, and add clarity
112 / 118
Using AI != Slop
113 / 118
Using AI != Slop
Slop is using unreviewed code from AI models
114 / 118
Using AI != Slop
Slop is using unreviewed code from AI models
115 / 118
Using AI != Slop
Slop is using unreviewed code from AI models
116 / 118
Using AI != Slop
Slop is using unreviewed code from AI models
117 / 118
118 / 118