Permalink
Browse files

dictionary added

  • Loading branch information...
1 parent 3726433 commit aa5976ec87e2eebd2e90115f639d571e3543a6ba @jabbalaci committed Oct 2, 2011
Showing with 28 additions and 0 deletions.
  1. +28 −0 dictionary/dictionary.py
View
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+"""
+A very simple lookup of a word.
+"""
+
+import sys
+import webbrowser
+
+
+_template = 'http://www.thefreedictionary.com/p/{word}'
+
+
+def process(word):
+ url = _template.format(word=word)
+ webbrowser.open(url)
+ print '# see the result in your web browser'
+
+
+#############################################################################
+
+
+if __name__ == "__main__":
+ if len(sys.argv) > 1:
+ process(sys.argv[1])
+ else:
+ print >>sys.stderr, "{0}: error: specify a word.".format(sys.argv[0])
+ sys.exit(1)

0 comments on commit aa5976e

Please sign in to comment.