Why is Python popular, while Lisp and Scheme aren't?

John Hunter jdhunter at ace.bsd.uchicago.edu
Wed Nov 20 00:47:50 EST 2002


>>>>> "Anna" == Anna  <revanna at mn.rr.com> writes:

    Anna> So if I´m still here asking, it´s because I need an answer
    Anna> that *isn´t* just a reference to the tutorial, something
    Anna> from a live human being... So, yeah, I guess I would
    Anna> consider it a brushoff, unless you took the time to expand
    Anna> on the tutorial in some way... Personally, I´d far rather
    Anna> get no answer than ¨RTFM, silly newbie¨... cuz chances are,
    Anna> I already did...

But we're much less likely to tell you to RTFM here.  Heck, we're
halfway friendly :-)

from __future__ import division
import urllib, re

rgx = re.compile('.*</b> of about <b>([\d,]+)</b>.*', re.MULTILINE|re.DOTALL)

# gotta do some tricks to get around google groups' user agent policy
class AppURLopener(urllib.FancyURLopener):
    def __init__(self, *args):
        self.version = "MSIE/5.0"
        apply(urllib.FancyURLopener.__init__, (self,) + args)

urllib._urlopener = AppURLopener()

# add some generic words for a baseline to control for total posts
words = ['rtfm', 'consider', 'internet', 'hell', 'shutup']
fmt = 'http://groups.google.com/groups?as_q=%s&safe=images&ie=UTF-8&oe=UTF-8&as_ugroup=*%s*&lr=&hl=en'
summary = {}
for group in ('perl', 'python'):
    for word in words:    
        url =  fmt % (word, group)
        s =  urllib._urlopener.open(url).read()
        m = rgx.match(s)
        if m: summary.setdefault(word, {})[group] = int( m.group(1).replace(',', '') )

for (key, val) in summary.items():

    try: perl, python = val['perl'], val['python']
    except KeyError: continue
    
    print 'Word: %s' % key
    print '\tperl: %d' % perl
    print '\tpython: %d' % python
    print '\trelfreq: %1.2f\n' % (perl/python)
    

Word: rtfm
	perl: 4880
	python: 451
	relfreq: 10.82

Word: shutup
	perl: 32
	python: 31
	relfreq: 1.03

Word: hell
	perl: 5400
	python: 5220
	relfreq: 1.03

Word: consider
	perl: 15600
	python: 8440
	relfreq: 1.85

Word: internet
	perl: 36700
	python: 10400
	relfreq: 3.53

(but it appears we might tell you to shutup...  well, I never would.)

John Hunter




More information about the Python-list mailing list