title: Error while reading /proc/$pid/status in python
body: <p>I've to read <code>/proc/pid/status</code> file to extract <code>NSpid</code> field like below:</p>
  <pre><code>user@user-HP-Pavilion-Notebook:~$ cat /proc/5979/status | grep NSpid
  NSpid:  5979    1417
  </code></pre>
  <p>I've to extract <code>1417</code> from this.</p>
  <p>I've tried below:</p>
  <pre><code>print(&quot;Traversing tree&quot;)
  pid=5947
  for c in psutil.Process(pid).children(True):
      cpid=c.pid
      print(str(c.pid))
      with open(&quot;/proc/cpid/status&quot;,'r') as origin_file:
          for line in origin_file:
              line = re.findall(r'NSpid', line)
              if line:
                  line = line[0].split('&quot;')[1]
              print(line)
              break
  </code></pre>
  <p>This program is traversing the whole process tree and for each children trying to extract NSpid from status file.
  But I'm getting the following error :</p>
  <pre><code>Traversing tree
  5979
  Traceback (most recent call last):
    File &quot;cmp.py&quot;, line 48, in &lt;module&gt;
      with open(&quot;/proc/cpid/status&quot;,'r') as origin_file:
  FileNotFoundError: [Errno 2] No such file or directory: '/proc/$cpid/status'
  </code></pre>
  <p>How to correct this?</p>