2

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 which 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?

2

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I now made a bash script that opend the code that you wrote and it worked thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.