As title mentioned, i wan check the process of a application.

What i wan is like tat:

When i start a process A, then the process A completed, process B will start after that. Once the process B started, then the script will start execute next step. Thanks for help.

The logic something like tat,

IF process B in Process(task manager):
do something....

Recommended Answers

All 4 Replies

In windows use tasklist , and in linux us ps . In either case, you'll need to search/grep out your process's name to see if it's running

can u clarify how to use the tasklist??

import os
os.system("tasklist")

run this script and Get jlm699's flavour

import os
os.system("tasklist")

run this script and Get jlm699's flavour

Yes, both tasklist and ps are command line executables in their respective OS. They print out a list of all the running processes. It will still be up to you to read the return and search for your program unless you know how to use grep. Although I'm not sure if windows has a grep-like feature. I'd assume no

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.