You're viewing a comment by Wolf Halton and its responses.

December 22, 2009, 02:50

I am getting a weird error

your example code in the readme file works great in the interactive but fails when I put it in a file
this is the code -->
>>> from xgoogle.search import GoogleSearch
>>> gs = GoogleSearch("catonmat")
>>> gs.results_per_page = 25
>>> results = gs.get_results()
>>> for res in results:
... print res.title.encode('utf8')

$ ./xgoogle_mod.py
from: can't read /var/mail/xgoogle.search
./xgoogle_mod.py: line 4: syntax error near unexpected token `('
./xgoogle_mod.py: line 4: `gs = GoogleSearch("quick and dirty")'

Whyever is it looking for /var/mail/xgoogle, when I have it loaded in dist-pkgs where the interactive imports it just fine. What am I missing?

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.