It is wonderful to automate boring stuffs with Python.
In Japan, new introductory books are being published every month and more and more Pythonistas are working on automation.
A Python script that is useful to you may be useful to others.
So I talk about how to enable others to use your script.
In this talk, I use a simple script which can reduce the width and the height of a specified image in your computer.
I assume someone who's read the introductory book can understand the script.
First, I introduce Command Line Interface (CLI) to solve hardcoding in the sample script.
After implementing CLI, you don't need to edit the script.
Second, I introduce Grafical User Interface (GUI) to make the script more user-friendly.
Finally, I introduce web application so that users can the script without installation. All users have to do is connecting the Internet!
The timeline is supposed to be the following:
# Introduction (3min)
- self-introduction
- motivation of this talk
- sample script (pathlib, Pillow)
# CLI (5min)
- problem: need to edit the script
- introduce argparse module (pass target file path from command line)
- about positional arguments and optional arguments
- check whether a path points an existing file (type parameter of add_argument())
# GUI (9min)
- problem: CLI is not easy to handle than GUI
- introduce eel
- eel's elements: HTML, CSS, JavaScript
- hello world in eel
- file access in eel app
- convert sample script to eel app (user can see which image is specified as target |