title: Globally override print statement python
body: <p>In a relatively large python3 codebase there are several print statments that are dotted through the code that I would like to find. It would make be significantly easier if the print function could be overridden so that it always prints the filename and line number. Example output:</p>
  
  <pre><code>&gt;&gt;&gt; print("Some Message")
  filename:line_number
  Some Message
  </code></pre>
  
  <p>In my case, this is particularly an issue because the python files are wrapped up inside binary blobs, and grepping for them is an exercise in futility, but the filenames given by the traceback module are still sensible.</p>
  
  <p>For a python2 solution, there is this question/answer:
  <a href="https://stackoverflow.com/questions/17600942/how-to-make-print-override-work-globally">How to make print() override work &quot;globally&quot;</a></p>