Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2015
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    code to display the running applications on a system

    Hi...I would be grateful if anyone could help me with a code to display the names of "applications" running on a system.

  2. #2
    New Coder
    Join Date
    Nov 2016
    Location
    South Africa, Cape Town
    Posts
    49
    Thanks
    1
    Thanked 1 Time in 1 Post
    There's a lot of ways to do what you're asking but a simple way would be to use the built in commands that come with the operating system, assuming you're on windows you could use:

    Code:
    import subprocess
    
    cmd = subprocess.Popen("tasklist /NH /FO CSV", shell=True, stdout=subprocess.PIPE)
    procs = str(cmd.communicate()).split()
    
    for x in procs:
        print x
    You'd have to filter out some of the information in the data to just get the process names.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •