Giter Club home page Giter Club logo

Comments (3)

giampaolo avatar giampaolo commented on July 19, 2024

Mmm I don't think it's worth it. Services are inherently bound to a name. Such a function would basically be a one-liner which you can easily implement in your own code.

Each new API you add makes the project and doc bigger / more complex, thus it has a cost. As such it makes sense to only add utility functions which solve a either complex or very common problem (like process_iter()).

from psutil.

arossert avatar arossert commented on July 19, 2024

@giampaolo Thanks for the reply, I just wonder if there is a Windows API to get the service by its PID and not the name it is worth exposing it as iterating over all the services just to find the one that I need can be a "heavy" call (I assume).

I'm not a windows expert so this API might not event exists 😃

from psutil.

giampaolo avatar giampaolo commented on July 19, 2024

I doubt it exists because the Windows API which returns a service handler accepts the service name (aka a string):

hService = OpenService(sc, service_name, access);

from psutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.