How a computer executes your Python script

This is how your computer's operating system executes Python script:

  1. When you type python <your_awesome_automation_script>.py in the shell, Python (which runs as a process) instructs your computer processor to schedule a thread (which is the smallest unit of processing):
  1. The allocated thread will start to execute your script, line by line. A thread can do anything, including interacting with I/O devices, connecting to routers, printing output, performing mathematical equations, and more.
  2. Once the script hits the End of File (EOF), the thread will be terminated and returned to the free pool, to ...

Get Hands-On Enterprise Automation with Python. now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.