I see.. that makes sense. Kind of new with python -- sorry for that. after printing using this:
print urllib.urlopen(' http://words.bighugelabs.com/api/2/e413f24801aa30b8d441ca43a64317be/moving/').read( ) I'm getting a format like this returned: adjective|sim|streaming adjective|sim|swirling adjective|sim|tossing adjective|sim|touching adjective|sim|touring adjective|sim|traveling adjective|sim|tumbling I assume I need to clean this up by reading past 'Adjective|sim|' to 'streaming' and then returning it from lookup().. this will be happening in the following: urllib.urlopen(' http://words.bighugelabs.com/api/2/e413f24801aa30b8d441ca43a64317be/moving/').read(SOMETHINGHERE) On Wed, Jul 8, 2009 at 10:29 PM, Rich Lovely <roadier...@googlemail.com>wrote: > 2009/7/9 Pete Froslie <fros...@gmail.com>: > > No problem, thanks for taking the time. > > > > I'm actually trying to resolve this error now: > > > > buff.append(" ".join(lookup(Word) for Word in line.split())) > > NameError: global name 'lookup' is not defined > > > > ..also assume I need to change 'Word' to something that checks the next > word > > in the text file and then replaces it with the one that is looked up.. > > working on that now. > > > > Pete F > > lookup() is the function that looks up the word in the thesaurus. I > left implementing that as an exercise for you, as I don't know the > format of the reference you're using. > -- > Richard "Roadie Rich" Lovely, part of the JNP|UK Famile > www.theJNP.com > -- Pete Froslie 617.314.0957 http://www.froslie.net
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor