code: def pid(self):
          
          # Support for pexpect's functionality.
          if hasattr(self.subprocess, 'proc'):
              return self.subprocess.proc.pid
          # Standard subprocess method.
          return self.subprocess.pid
docs: The process' PID.