title: strace a python function
body: <p>Is it possible to strace a python function for opened files, and differentiate if they were opened by python or a subprocess?</p>
  
  <pre><code>read_python, read_external = [], []
  
  @strace_read(read_python, read_external)
  function test():
      file = open("foo.txt", "r")
      subprocess.call(["cat", "bar.txt"])
  
  for file in read_python:
      print("python:      ", file)
  for file in read_external:
      print("external:    ", file)
  </code></pre>
  
  <p>So the output is as:</p>
  
  <pre><code>&gt;&gt;&gt; python:      foo.txt
  &gt;&gt;&gt; external:    bar.txt
  </code></pre>
  
  <p>I'm most interested in using a decorator. Differentiating isn't a priority.</p>
  
  <p>Conceptually, my best guess is to replace instances of <code>load_function(open)</code> with wrappers ... actually, I have no idea, there are too many ways to access <code>open</code>.</p>