classifier systems re-coded in Python?

Skip Montanaro skip at pobox.com
Mon Nov 18 23:03:29 EST 2002


    Robert> Is google() a real command from some Python module, or were you
    Robert> just being Programmer-ish? If it's from a module, is it
    Robert> PyGoogle, or something else?

Terry was probably just being programmer-ish, but what he implied isn't hard
to do.  I have a google shell script:

    #!/bin/bash
    args=`echo $@ | /Users/skip/local/bin/quote`
    open 'http://www.google.com/search?q='$args'&sourceid=opera&num=25&ie=utf-8&oe=utf-8'

("open" is a MacOSX command.  On other Unix-ish systems you might replace it
with "netscape -remote" or something similar.)

The quote command is

    #!/usr/bin/env python
    import urllib, sys
    sys.stdout.write(urllib.quote_plus(sys.stdin.read()))

At the shell prompt I can execute

    google holland learning classifier python

and have the search pop up in my default browser.

-- 
Skip Montanaro - skip at pobox.com
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list