Learning Python for System Automation

I was recently asked

How do you learn Python for system automation?

My suggestion is to first learn the basics of Python.

A good way to explore is with Jupyter Notebook or Google Colab, which is Google’s version of the same.

Jupyter (or Colab) presents a notebook like interface, encouraging documentation of your (coding) experiments. All content in a notebook is entered into cells, and cells can contain text, or code to execute.

It makes for a very dynamic learning and experimentation experience.

TutorialsPoint has an introductory tutorial for Colab.

My suggestion would be to read the Introduction, What is Google Colab, Your First Colab Notebook, Documenting Your Code, Google Colab – Saving Your Work, and then work through the Learning Python 3 notebook. (This notebook should be able to be uploaded to Google Colab.)

Then return to the TutorialsPoint introduction to peruse more advanced Colab facilities.

Aim to be comfortable with:

  • basic Python code layout (tabs for blocks)
  • simple input/output (e.g. print() and format strings)
  • variables (numbers, strings, tuples, lists, dictionaries, and “duck typing”)
  • loops
  • logic (decisions)

Next steps would be to install a Python IDE (Integrated Development Environment) to create scripts on your own computer.

Visual Studio Code is a free, popular, and good option- work through their Getting Started with Python in VSCode. And it works on Windows, MacOS, and Linux 🙂

Now the fun can begin!

Use Python to automate file management or remote control applications for windows or mac.

Tip

Graphical User Interfaces (GUIs) rely on a queue of events (such as mouse move, button click, key press, …) being recorded by the operating system which the application then processes in order. To figure out how to automate something in a GUI application, take your best guess at the type (class) of event and Google search that class + “event injection”. e.g. to find out how to fake mouse movement from Python, try searching for “Python windows mouse event injection”.

The short URL of the present article is: https://makeit.zone/go/pd0y
Scroll to Top