Session Ready
Exercise

Running a click application from subprocess

You are building many click command line applications and you realize that it would be powerful to automate their execution by not only humans but other scripts. Take an existing script that performs KMeans clustering and execute it with two different options: help and num. Run this inside of subprocess.run and print both outputs to standard out.

Instructions
100 XP
  • Run the cluster.py click application to retrieve a help message using the help flag.
  • Run the cluster.py click application with num option of 2.
  • Assign the output of the first subprocess to help_out and print stdout.
  • Assign the output of the second subprocess to cluster2 and print stdout.