-1

Ok so I started using psutil 2.1.1 with Python 2.7.6 and I wanted to test some commands as follows:

import psutil
psutil.pids()
p = psutil.Process(6096)
p.name() # gives u'googletalk.exe'
p.terminal()

These are the commands I used from the psutil 2.1.1 documentation, I used every command from the process management section.

The moment I use p.terminal I get the error:

'Process' object has no attribute 'terminal'

I used the above code in both the shell and a new file with the same result.

rhughes
  • 9,257
  • 11
  • 59
  • 87

1 Answers1

1
p = psutil.Process(6096)
p.name() # gives u'googletalk.exe'

According to the process name googletalk.exe you are using Windows. The Process.terminal() method is not implemented for Windows (Windows doesn't have the concept of Terminals in a way *nix-like systems have).

The common implementation of class Process (_ init_.py) refers to the platform-specific implementations (line 610, assigned by line 317) - that's why you get an error (not defined in _pswindows.py).

muffel
  • 7,004
  • 8
  • 57
  • 98