News for hackers. Stuff that matters.
Re:Homogenization of scientific computing – Python is eating... by krapp on Friday January 10, 2014 @06:25PM (#7040383)
Here's mine for what it's worth, since this is one of the Google python assignments. Admittedly, i'm not very proficient at all.

   def get_file_words(filename):
     file = open(filename, 'rU')
     words = {}
     for line in file:
       for word in [word.lower() for word in line.split()]:
         if not word in words.keys():
           words[word] = 1
         else: words[word]+=1
     return words


   def print_words(filename):
     wordcount = get_file_words(filename)
     for word in wordcount:
       print word, wordcount[word]

There are no comments on this comment yet.