title: Python 2.6.6: Binding print to any other function causes 'Syntax Error'
body: <p>I'm trying to implement a basic debugging flag into my code. I'm planning on doing this by binding print to logFile.write so instead of logging the process my code executes, it'll print it so the user can see it done and see where it may mess up. I do the same technique by binding raw_input to input for backwards compatibility for python 2 and python 3, but when I try binding print to anything, I get a Syntax Error.</p>
  
  <p>On Python 3 on Windows the line runs correctly, but when run on python 2 on UNIX or Windows it fails.</p>
  
  <pre class="lang-py prettyprint-override"><code># If user has passed the 'debug' parameter then no log file will be created and instead will be printed in terminal
  if (len(sys.argv) &gt; 1 and sys.argv[1] == 'debug') or (len(sys.argv) &gt; 2 and (sys.argv[1] == 'debug' or sys.argv[2] == 'debug')):
      try:
          logFile.write = print
      except:
          print('Debug is not working at this time')
  </code></pre>
  
  <p>This is the error I receive</p>
  
  <pre><code>SyntaxError: invalid syntax
  lax94t01&gt; ./Automation.py userconfig.ini debug
    File "./Automation.py", line 55
      logFile.write = print
                          ^
  </code></pre>