Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language Python

(Creative version)

Date:11/06/05
Author:Schizo
URL:n/a
Comments:11
Info:http://www.python.org/
Score: (3.62 in 221 votes)
'''A more interesting way to get the lyrics to "99 Bottles of Beer on the Wall", in Python.
Is this considered cheating?'''
              
import re, urllib
print re.sub('</p>', '', re.sub('<br>|<p>|<br/> |<br/>','\n', re.sub('No', '\nNo', 
urllib.URLopener().open('http://www.99-bottles-of-beer.net/lyrics.html').read()[3516:16297])))

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
This example demonstrates the simplicityGerold Penz07/23/054
minimal versionOliver Xymoron04/20/053
Advanced, extensible beer/wall frameworkJamie Turner05/17/063
Exception basedMichael Galpin02/08/080
Fully compliant versionRicardo Garcia Gonzalez01/15/065
Using a iterator classEric Moritz01/20/062
using lambda in LISP styleJ Adrian Zimmer11/14/060
New conditional expressions in 2.5Ezequiel Pochiero12/18/060
functional, w/o variables or proceduresIvan Tkatchev07/14/051
minimal version with singularEmlyn Jones06/13/052

Comments

>>  Daniel said on 03/10/06 06:07:13

Daniel I'm giving you five stars, just for being a smartass.

>>  forrestcupp said on 07/31/06 15:05:51

forrestcupp Yeah, that's cheating

>>  2kzombie said on 05/07/07 20:59:17

2kzombie Thats just ingenius. In simplicty we trust, code is great ;)

>>  Grega said on 12/18/07 23:11:34

Grega TOP GEEK :)

>>  byeTwo said on 01/01/08 20:23:39

byeTwo In-genius.
I beleive this is not cheating.

>>  Mike said on 01/26/08 17:40:01

Mike Brilliant.

>>  Wes said on 02/10/08 11:25:41

Wes Honestly now, I would say congrats on pulling off a smart-ass method, but it doesn't have any tolerance for error, so for that reason alone I'm going to give a rating of 3. Nice concept, none-the-less.

>>  Anirudh said on 03/02/08 10:44:55

Anirudh nice, but if the source code or the site design is changed even the slightest bit, your code won't work.

>>  Brad said on 03/08/08 22:01:08

Brad
OK. 10 for uber-geekness. 1 for utility. I'm kicking the tires on scripting languages right now. I've been an OO Java developer for 10 years (since 1.1.3beta) but the weakest link in my tool box is lack of a scripting language. So looking at this side-by-side with Ruby, Groovy, et al. does me no good.

>>  Andrew said on 05/01/08 08:28:44

Andrew Smartass version for sure!

>>  Dylan said on 05/05/08 00:31:57

Dylan winrar

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: