RSH 8: Command line arguments and running tasks in parallel

Collaborative notes taken during the session

Icebreaker

Where are you watching from and how is the weather at your place?

First time with command line

Questions

from multiprocessing import Pool
from pathlib import Path

def task(filename):
    # computationally intensive task
    # or even shell process using os.system(..) or subprocess.run(..)
    print(filename)


with Pool() as pool:
    files = Path.cwd().glob("*.jpg")
    pool.map(task, files)

Ideas that were suggested via Twitch chat