summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-04-24 13:46:00 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2017-04-24 13:46:00 +0200
commitee722d4a14224e2331a8b7e44af0e5f6755c0c03 (patch)
tree842830be64109f3161609ce2f699e01d8d15788a
parenta2e36c9b7b6eecfefc204f1368033b7c22c9e219 (diff)
downloadpsutil-ee722d4a14224e2331a8b7e44af0e5f6755c0c03.tar.gz
update README
-rw-r--r--README.rst15
-rw-r--r--psutil/__init__.py4
2 files changed, 17 insertions, 2 deletions
diff --git a/README.rst b/README.rst
index c65ec1af..4f23b2a2 100644
--- a/README.rst
+++ b/README.rst
@@ -395,6 +395,21 @@ Further process APIs
>>> gone, alive = psutil.wait_procs(procs_list, timeout=3, callback=on_terminate)
>>>
+Popen wrapper:
+
+ >>> import psutil
+ >>> from subprocess import PIPE
+ >>> p = psutil.Popen(["/usr/bin/python", "-c", "print('hello')"], stdout=PIPE)
+ >>> p.name()
+ 'python'
+ >>> p.username()
+ 'giampaolo'
+ >>> p.communicate()
+ ('hello\n', None)
+ >>> p.wait(timeout=2)
+ 0
+ >>>
+
Windows services
================
diff --git a/psutil/__init__.py b/psutil/__init__.py
index 71ba3412..4e68a46d 100644
--- a/psutil/__init__.py
+++ b/psutil/__init__.py
@@ -1067,7 +1067,7 @@ class Process(object):
# interval was too low
return 0.0
else:
- # Note 1.
+ # Note 1:
# in order to emulate "top" we multiply the value for the num
# of CPU cores. This way the busy process will be reported as
# having 100% (or more) usage.
@@ -1076,7 +1076,7 @@ class Process(object):
# taskmgr.exe on Windows differs in that it will show 50%
# instead.
#
- # Note #3:
+ # Note 3:
# a percentage > 100 is legitimate as it can result from a
# process with multiple threads running on different CPU
# cores (top does the same), see: