code: def write_pid(self, pid):
          
          self.fpid.seek(0)
          self.fpid.truncate()
          self.fpid.write("%d" % pid)
          self.fpid.close()
          del self.fpid
docs: Write pid to the pid file
  
          :param pid: pid of the process
          :type pid: None | int
          :return: None