title: Python: Adding a column of the same value
body: <p>I have a tab-delimeted file that contains 3 columns. I would like to add a new first column of just same number 1. </p>
  
  <p>inputfile is </p>
  
  <pre><code>a 3 6
  b 3 5
  c 3 5 
  d 8 4 
  </code></pre>
  
  <p>This is what I would like to have for my outputfile:</p>
  
  <pre><code>1 a 3 6
  1 b 3 5
  1 c 3 5
  1 d 8 4
  </code></pre>
  
  <p>This is what I have so far: </p>
  
  <pre><code>#!/usr/bin/env python
  import sys
  import csv  
  f=open('inputfile.txt', 'r+')
  t=[]
  for line in f.readlines():
      t.append('\n')
      t.append(1)
      f.writelines(t)
  </code></pre>
  
  <p>However, I am getting an error: 
  Traceback (most recent call last):
    File "./py.py", line 6, in 
      sys.stdout('inputfile.txt', 'w')
  TypeError: 'file' object is not callable</p>