Did I find the right examples for you? yes no

All Samples(39)  |  Call(30)  |  Derive(0)  |  Import(9)
A more convenient interface to stdlib subprocess module.
    It starts a sub process and deals with it exactly as when using
    subprocess.Popen class but in addition also provides all the
    property and methods of psutil.Process class in a single interface:

      >>> import psutil
      >>> from subprocess import PIPE
      >>> p = psutil.Popen(["/usr/bin/python", "-c", "print 'hi'"], stdout=PIPE)
      >>> p.name
      'python'(more...)

src/c/i/circus-0.10.0/circus/process.py   circus(Download)
import warnings
 
from psutil import Popen, STATUS_ZOMBIE, STATUS_DEAD, NoSuchProcess
 
from circus.py3compat import bytestring, string_types
            extra['stderr'] = PIPE
 
        self._worker = Popen(args, cwd=self.working_dir,
                             shell=self.shell, preexec_fn=preexec_fn,
                             env=self.env, close_fds=not self.use_fds,

src/c/i/circus-HEAD/circus/process.py   circus(Download)
import warnings
 
from psutil import Popen, STATUS_ZOMBIE, STATUS_DEAD, NoSuchProcess
 
from circus.py3compat import bytestring, string_types, quote
            extra['stderr'] = PIPE
 
        self._worker = Popen(args, cwd=self.working_dir,
                             shell=self.shell, preexec_fn=preexec_fn,
                             env=self.env, close_fds=not self.use_fds,

src/l/a/launch.py-HEAD/system/process_helper.py   launch.py(Download)
            cmd.extend(*args)
 
        p = psutil.Popen(cmd,
                         close_fds=True,
                         cwd=settings['process_cwd'],

src/h/t/HTPC-Manager-HEAD/modules/stats.py   HTPC-Manager(Download)
        try:
            if htpc.SHELL:
                r = psutil.Popen(cmd, stdout=PIPE, stdin=PIPE, stderr=PIPE, shell=False)
                msg = r.communicate()
                d['msg'] = msg

src/s/i/simplepvr-HEAD/python/simplepvr/simple_pvr/hdhomerun.py   simplepvr(Download)
from threading import Timer
from subprocess import PIPE, call, check_call#, check_output # check_output is Python 2.7 only (Synology DSM 4 comes with 2.6)
from psutil import Popen
 
from .pvr_logger import logger
def check_cmd_output(cmd):
    proc = Popen(cmd, stdout=PIPE, shell=True)
    exit_code = proc.wait(timeout=5)
    if exit_code != 0:
        raise ValueError(u"No HDHR device found")
def system(cmd, timeout = 60):
    global proc
    logger().info(u"Executing command '{0}'".format(cmd))
    proc = Popen(cmd, close_fds=True, shell=True, stdout=PIPE)
    logger().info(u"PID is {0} for command '{1}'".format(proc.pid, cmd))
    def _spawn_recorder_process(self, tuner, directory):
        save_cmd = u'{0} save /tuner{1} "{2}" > "{3}"'.format(self._hdhr_config_prefix(), str(tuner), os.path.join(directory, 'stream.ts'), os.path.join(directory, 'hdhomerun_save.log'))
 
        logger().info(u"Executing command '{0}'".format(save_cmd))
        recordingProcess = Popen(save_cmd, close_fds=True, shell=True, stdout=open('/dev/null', 'w'), stderr=subprocess.STDOUT)
 
        logger().info(u"Executing command '{0}'".format(command))
        my_hdhr_process = Popen(command, close_fds=True, shell=True, stdout=open('/dev/null', 'w'), stderr=subprocess.STDOUT)
        return my_hdhr_process
 

src/k/c/kcc-HEAD/kcc/KCC_gui.py   kcc(Download)
from xml.dom.minidom import parse
from html.parser import HTMLParser
from psutil import virtual_memory, Popen, Process
from .shared import md5Checksum
from . import comic2ebook
                MW.hideProgressBar.emit()
                MW.modeConvert.emit(1)
                Popen(path[0] + '.exe  /SP- /silent /noicons')
                MW.forceShutdown.emit()
            except Exception:
        try:
            if os.path.getsize(self.work) < 629145600:
                output = Popen('kindlegen -dont_append_source -locale en "' + self.work + '"', stdout=PIPE,
                               stderr=STDOUT, shell=True)
                for line in output.stdout:
                            '<a href="https://github.com/ciromattia/kcc/wiki/Important-tips">important tips</a>.',
                            'info')
        kindleGenExitCode = Popen('kindlegen -locale en', stdout=PIPE, stderr=STDOUT, shell=True)
        if kindleGenExitCode.wait() == 0:
            self.KindleGen = True
            formats = ['MOBI', 'EPUB', 'CBZ']
            versionCheck = Popen('kindlegen -locale en', stdout=PIPE, stderr=STDOUT, shell=True)

src/k/c/kcc-HEAD/kcc/cbxarchive.py   kcc(Download)
from zipfile import is_zipfile, ZipFile
from subprocess import STDOUT, PIPE
from psutil import Popen
from shutil import move, copy
from . import rarfile
            copy(self.origFileName, os.path.join(os.path.dirname(self.origFileName), 'TMP_KCC_TMP'))
            self.origFileName = os.path.join(os.path.dirname(self.origFileName), 'TMP_KCC_TMP')
        output = Popen('7za x "' + self.origFileName + '" -xr!__MACOSX -xr!.DS_Store -xr!thumbs.db -o"'
                       + targetdir + '"', stdout=PIPE, stderr=STDOUT, shell=True)
        extracted = False

src/p/l/play-HEAD/bot.py   play(Download)
        try:
            self._process = psutil.Popen(
                self._player_command.split(),
                stdout=PIPE,
                stdin=PIPE,

src/t/h/Thinkpol-0.1.0/Thinkpol/supervisor.py   Thinkpol(Download)
	def keep_alive(self):
		self._p = psutil.Popen(self.cmd, shell=False, stdout=PIPE)
		self._running = True
		while self._running:
			if str(self._p.status) == "zombie":
				self._p = psutil.Popen(self.cmd, shell=False, stdout=PIPE)
			if not self._p.is_running():
				self._p = psutil.Popen(self.cmd, shell=False, stdout=PIPE)

src/b/a/baruwa-2.0.1/bin/import-mbox.py   baruwa(Download)
def hostname():
    "return the hostname"
    pipe = psutil.Popen(["hostname"],
                        stdout=subprocess.PIPE,
                        stderr=subprocess.PIPE)

  1 | 2  Next