zoukankan      html  css  js  c++  java
  • Python内置的subprocess.Popen对象

    具体内容参见:https://docs.python.org/3/library/subprocess.html

    大概来说,就是可以对应输入的命令产生一个进程,该进程实例内置如下方法。

     |  communicate(self, input=None, timeout=None)
     |      Interact with process: Send data to stdin.  Read data from
     |      stdout and stderr, until end-of-file is reached.  Wait for
     |      process to terminate.  The optional input argument should be
     |      bytes to be sent to the child process, or None, if no data
     |      should be sent to the child.
     |      
     |      communicate() returns a tuple (stdout, stderr).
     |  
     |  kill = terminate(self)
     |  
     |  poll(self)
     |  
     |  send_signal(self, sig)
     |      Send a signal to the process.
     |  
     |  terminate(self)
     |      Terminates the process.
     |  
     |  wait(self, timeout=None, endtime=None)
     |      Wait for child process to terminate.  Returns returncode
     |      attribute.

    在windows系统中,kill是terminate方法的别名,在linux系统中,kill向进程发送SIGKILL信号,terminate方法向进程发送SIGTERM信号。

  • 相关阅读:
    公众号我也快看不下去了
    朋友圈我快看不下去了!
    微信5.2
    微信支付类目及费率
    ACCESS TOKEN
    关于微博认证和微信认证
    重定向
    微信公众账号支付商户接入指南
    微信公众平台开发(94) 违章查询
    [Servlet]什么是Servlet
  • 原文地址:https://www.cnblogs.com/lyg-blog/p/8966978.html
Copyright © 2011-2022 走看看