title: Read inputfile as csv in python
body: <p>I want to read a csv file from STDIN and operate on it.</p>
  
  <p>The following is the code for reading the csv file and doing the operation needed. This works fine. But I want to take the input from STDIN. </p>
  
  <pre><code>import csv
  with open('hospital_data.csv', 'rb') as csvfile:
      myDict = {}
  
      csvreader = csv.reader(csvfile, delimiter=',')
      for row in csvreader:
          if row[6] not in myDict.keys():
              #print 'Zipcode: ' + row[6] + ' Hospital code: ' + row[1]
              myDict[row[6]] = 1
          elif row[6] in myDict.keys():
              #print 'value in row '+ str(myDict[row[6]])
              myDict[row[6]] += 1
  </code></pre>
  
  <p>Is there a way in Python to read the file from STDIN as a csv file ? </p>