I want to monitor the power that my system needs when I run a benchmark. When the benchmark ends the monitoring process should be killed. The monitor script is written in python. The script wich starts the monitoring script must be a Bash-script because its should be started with the same script as the Benchmark.How do I do that?
Asked
Active
Viewed 47 times
1 Answers
1
import os, sys
if "benchmark" not in os.popen('tasklist').read():
sys.exit()
Checks if a process "benchmark" is in the tasklist and if not closes the python script. Easiest answer I think.
GittingGud
- 295
- 1
- 14
-
2I now made a bash script that opend the code that you wrote and it worked thanks! – John Carr Apr 26 '19 at 11:40