psutilProcesspid
psutil.Process(pid) is a class in the psutil library that represents a system process identified by its process ID (pid). The pid must be a positive integer. A Process object provides access to the process’s metadata, status, and resource usage, and it also exposes methods to control the process or wait for it to finish.
Common information exposed through a Process object includes name(), exe(), cmdline(), status(), and ppid(). The object
Process control and lifecycle methods enable management of the target process. terminate() sends a polite termination
Error handling and permissions are important considerations. Operations may raise psutil.NoSuchProcess if the process no longer
Cross-platform notes: psutil aims to provide a consistent API across major operating systems, but some fields,