Getting Down to Code Step 3
Step 3: Make an object to wrap the functionality
def lookupWord(self, word):
# Need to get a tmp file name here
os.system('webster ‘ + word + ‘ > /tmp/websterResult')
fd = open('/tmp/websterResult')
# Throw away the first line (reports on contacting Webster server):
os.system('rm /tmp/websterResult')
websterObj = WebsterLookup()
print websterObj.lookupWord('information')
Put into file WordLookupServer.py: