Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3992030
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:43:03+00:00 2026-05-20T06:43:03+00:00

Lets say I import a module. In order for me to make the best

  • 0

Lets say I import a module. In order for me to make the best use of it, I would like to know what properties, methods, etc. that I can use. Is there a way to find that out?

As an example: Determining running programs in Python

In this line:

os.system('WMIC /OUTPUT:C:\ProcessList.txt PROCESS get Caption,Commandline,Processid')

Let’s say I wanted to also print out the memory consumed by the processes. How do I find out if that’s possible? And what would be the correct ‘label’ for it? (just as the author uses ‘Commandline’, ‘ProcessId’)

Similarly, in this:

import win32com.client
def find_process(name):
    objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
    objSWbemServices = objWMIService.ConnectServer(".", "root\cimv2")
    colItems = objSWbemServices.ExecQuery(
         "Select * from Win32_Process where Caption = '{0}'".format(name))
    return len(colItems)

print find_process("SciTE.exe")

How would I make the function also print out the memory consumed, the executable path, etc.?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:43:04+00:00Added an answer on May 20, 2026 at 6:43 am

    As for Python modules, you can do

    >>> import module
    >>> help(module)
    

    and you’ll get a list of supported methods (more exactly, you get the docstring, which might not contain every single method). If you want that, you can use

    >>> dir(module)
    

    although now you’d just get a long list of all properties, methods, classes etc. in that module.

    In your first example, you’re calling an external program, though. Of course Python has no idea which features wmic.exe has. How should it?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have some code (using CherryPy) that looks like this: import cherrypy
have You ever tried to import classic c++/make project into QtCreator ? Lets say
Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user
Lets say I have an array like this: string [] Filelist = ... I
Lets say I have path to a module in a string module_to_be_imported = 'a.b.module'
I have paused a script for lets say 3500 seconds by using time module
lets say I have an NSWindow Class, that has several events for mouse and
Lets say , there are some import statements in a class. When the byte
Possible Duplicate: Unload a module in Python After importing Numpy, lets say I want
Lets say i have the following bit of code import java.sql.Connection; import java.sql.DriverManager; import

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.