Session Ready
Exercise

Running processes script

The year is 2040 and you share a Unix terminal with a mixture of AI and human co-workers. Recently your AI boss has been shorter than usual in your telepathic exchanges. You notice your daily meal biscuit quality has been downgraded to "sufficient" from "good". You are concerned your AI boss may recommend a transfer to the social media news content moderation team. One day your AI boss asks you to monitor CPU usage. They suspect someone is using CPU processing power to run other code instead of writing unit tests for the code the AI bots produce.

Write a script using subprocess.run and ps aux that discards all CPU output with the string 'python' in it. This will hide your secret Python scripts from the AI.

Instructions
100 XP
  • Use subprocess.run to execute ps aux.
  • Discard lines with 'python' in them.
  • Print out all other lines.