Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Text-to-speech

148 views
Skip to first unread message

Charles Hartman

unread,
Mar 19, 2005, 10:40:17 PM3/19/05
to pytho...@python.org
Does anyone know of a cross-platform (OSX and Windows at least) library
for text-to-speech? I know there's an OSX API, and probably also for
Windows. I know PyTTS exists, but it seems to talk only to the Windows
engine. I'd like to write a single Python module to handle this on both
platforms, but I guess I'm asking too much -- it's too hardware
dependent, I suppose. Any hints?

Charles Hartman
Professor of English, Poet in Residence
http://cherry.conncoll.edu/cohar
http://villex.blogspot.com

Robert Kern

unread,
Mar 19, 2005, 11:37:59 PM3/19/05
to
Charles Hartman wrote:
> Does anyone know of a cross-platform (OSX and Windows at least) library
> for text-to-speech? I know there's an OSX API, and probably also for
> Windows. I know PyTTS exists, but it seems to talk only to the Windows
> engine. I'd like to write a single Python module to handle this on both
> platforms, but I guess I'm asking too much -- it's too hardware
> dependent, I suppose. Any hints?

Googling around a bit, I get

http://www.freebsoft.org/speechd
http://www.festvox.org/festival/
http://www.speech.cs.cmu.edu/flite/

Some of them might be useful as a start.

--
Robert Kern
rk...@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Tim Churches

unread,
Mar 20, 2005, 2:10:05 AM3/20/05
to Charles Hartman, pytho...@python.org
Charles Hartman wrote:
> Does anyone know of a cross-platform (OSX and Windows at least) library
> for text-to-speech? I know there's an OSX API, and probably also for
> Windows. I know PyTTS exists, but it seems to talk only to the Windows
> engine. I'd like to write a single Python module to handle this on both
> platforms, but I guess I'm asking too much -- it's too hardware
> dependent, I suppose. Any hints?
>
> Charles Hartman
> Professor of English, Poet in Residence
> http://cherry.conncoll.edu/cohar

No, but I do wonder how many other users of Python are
poets-in-residence, or indeed, published poets?

And congratulations on the release of Scandroid Version 1.0a (written in
Python) on 18.iii.05 (as you elegantly record it).

All this begs the question: Have any poems been written in Python
(similar to the well-known Perl Poetry (see
http://directory.google.com/Top/Computers/Programming/Languages/Perl/Poetry/
)?

Indeed, have any poems ever been written about Python - other than "The
Zen of Python" by Tim Peters? A limerick, even?

There once was a language called Python...

(which is pretty close to having three anapaestic left feet)

or more promisingly, rhyme-wise, but metrically rather worse :

There once was a mathematician named van Rossum...

Tim C

Francis Girard

unread,
Mar 20, 2005, 4:10:48 PM3/20/05
to pytho...@python.org, Charles Hartman
Hello M. Hartman,

It's a very big opportunity for me to find someone that both is a poet and
knows something about programming.

First, please excuse my bad english ; I'm a french canadian.

I am dreaming to write a software to help french poets to write strict
rigourous classical poetry. Since calssical poetry is somewhat mathematical,
a lot of tasks can be automatised :

1- Counting the number of syllabs ("pied" in french) in a verse

2- Checking the rimes ; determining the strength of a rime

3- Checking compliance of a poem to a fixed pre-determined classical form (in
french, we have distique, tercet, quatrain, quintain, sixain, huitain,
dizain, triolet, vilanelle, rondeau, rondel, ballade, chant royal, sonnet,
etc.)

4- Propose a synonym that will fit in a verse, i.e. with the right amount of
syllabs

5- Suggest a missing word or expression in a verse by applying the Shannon
text generation principle

First, do you think it may be a useful tool ?
What other features you think can make it usefull for a poet ?

The first task of cutting sentences into syllabs (phonetically of course, not
typographically) is already done. It's been difficult to get it right and to
make it guess correctly with a very very high percentage.

I can very well imagine that the next task is even more difficult. I need to
translate text into phonems. Do you know some software that does it ? I guess
that voice synthetisers that translates written text into spoken text must
first translate the text into phonems. Right ? Do you know if there some way
that I can re-use some sub-modules from these projects that will translate
text into phonems ?

Regards,

Francis Girard

Le dimanche 20 Mars 2005 04:40, Charles Hartman a écrit :
> Does anyone know of a cross-platform (OSX and Windows at least) library
> for text-to-speech? I know there's an OSX API, and probably also for
> Windows. I know PyTTS exists, but it seems to talk only to the Windows
> engine. I'd like to write a single Python module to handle this on both
> platforms, but I guess I'm asking too much -- it's too hardware
> dependent, I suppose. Any hints?
>
> Charles Hartman
> Professor of English, Poet in Residence
> http://cherry.conncoll.edu/cohar

> http://villex.blogspot.com

Steve Holden

unread,
Mar 20, 2005, 4:18:14 PM3/20/05
to
Of course this last suggestion clearly has the wrong meter for a good
limerick. Not everyone knows the ingredients of a good limerick, which
led to the following (which has been around in various forms since God
was a lad):

There was a young man from Japan
Who never quite learned how to scan.
He got on quite fine
Until the last line
And then somehow he could never quite get the number of syllables
right,or make it rhyme.

So, let's accept that the first line should scan correctly, that would
make the following first lines acceptable:

A mathematician named Guido ...
The inventor of Python, called Guido ...
A mathematician (van Rossum) ...
Van Rossum, inventor of Python ...

Hopefully that will begin to get the idea across.

Since it's PyCon week, I will offer a prize of $100 to the best (in my
opinion) limerick about Python posted to this list (with a Cc: to
py...@python.org) before midday on Friday. The prize money will be my
own, so there are no other rules. I will post my judgment when the PyCon
nonsense has died down a little, but the winner will be read before the
entire PyCon audience. Get to it!

regards
Steve
--
Meet the Python developers and your c.l.py favorites March 23-25
Come to PyCon DC 2005 http://www.pycon.org/
Steve Holden http://www.holdenweb.com/

jamesthie...@gmail.com

unread,
Mar 20, 2005, 4:25:24 PM3/20/05
to
On some flavors of Windows you can use:
import pyTTS

tts = pyTTS.Create()
tts.Speak('This is the sound of my voice.')

On Mac OS X you can use:
import os

os.system("say 'This is the sound of my voice.'")

You could write a wrapper that takes a string and checks to see which
OS you are on and executes the appropriate of the two above choices.
But you probably need something slicker, and I don't know what that
might be.

Jeremy Bowers

unread,
Mar 20, 2005, 4:33:09 PM3/20/05
to
On Sun, 20 Mar 2005 16:18:14 -0500, Steve Holden wrote:
> Since it's PyCon week, I will offer a prize of $100 to the best (in my
> opinion) limerick about Python posted to this list (with a Cc: to
> py...@python.org) before midday on Friday. The prize money will be my
> own, so there are no other rules. I will post my judgment when the PyCon
> nonsense has died down a little, but the winner will be read before the
> entire PyCon audience. Get to it!
>
> regards
> Steve

Practicality beats purity,
Errors should never pass silently.
Sparse is better than dense,
Flat is better than nest,
Beautiful is better than ugly.

No cc because A: I'm not really serious and B: Tim Peters would have to
get some credit for that. :-) Probably ought to add a C: While I think
that does mostly rhyme, it is pretty loose; not much source material to
work with.

Charles Hartman

unread,
Mar 20, 2005, 4:38:13 PM3/20/05
to pytho...@python.org
-- or ". . . a guru named Guido / (Who monitors everything we do) /"
and ending with something about "looking max in a Speedo," but
fortunately it's not coming to me at the moment.

The closest I have an answer to your questions about Python and poetry
(aside from the Scandroid) is a book called *Virtual Muse: Experiments
in Computer Poetry* which Wesleyan published something close to ten
years ago; I don't think it's out of print yet, but I don't keep good
track. It was out of a casual remark there (about a very primitive
program not even directly talked about in the boolk) that there came a
casual remark from a reader last year which led to the Scandroid.

Charles Hartman

"The time has come for someone to put his foot down; and that foot is
me." --Animal House

Charles Hartman

unread,
Mar 20, 2005, 4:49:37 PM3/20/05
to Francis Girard, pytho...@python.org
On Mar 20, 2005, at 4:10 PM, Francis Girard wrote:

> Hello M. Hartman,
>
> It's a very big opportunity for me to find someone that both is a poet
> and
> knows something about programming.
>
> First, please excuse my bad english ; I'm a french canadian.

My French is a great deal worse than your English; fear not.

>
> I am dreaming to write a software to help french poets to write strict
> rigourous classical poetry. Since calssical poetry is somewhat
> mathematical,
> a lot of tasks can be automatised :
>
> 1- Counting the number of syllabs ("pied" in french) in a verse
>
> 2- Checking the rimes ; determining the strength of a rime
>
> 3- Checking compliance of a poem to a fixed pre-determined classical
> form (in
> french, we have distique, tercet, quatrain, quintain, sixain, huitain,
> dizain, triolet, vilanelle, rondeau, rondel, ballade, chant royal,
> sonnet,
> etc.)
>
> 4- Propose a synonym that will fit in a verse, i.e. with the right
> amount of
> syllabs
>
> 5- Suggest a missing word or expression in a verse by applying the
> Shannon
> text generation principle
>
> First, do you think it may be a useful tool ?

That is a very deep question. (See below.)

> What other features you think can make it usefull for a poet ?
>
> The first task of cutting sentences into syllabs (phonetically of
> course, not
> typographically) is already done. It's been difficult to get it right
> and to
> make it guess correctly with a very very high percentage.
>
> I can very well imagine that the next task is even more difficult. I
> need to
> translate text into phonems. Do you know some software that does it ?
> I guess
> that voice synthetisers that translates written text into spoken text
> must
> first translate the text into phonems. Right ? Do you know if there
> some way
> that I can re-use some sub-modules from these projects that will
> translate
> text into phonems ?

The problems are hard ones. Getting reliable syllable divisions is, all
by itself, a heart-breaker in English; I'm not sure whether harder or
easier in French. (See the module syllables.py in the source code to my
Scandroid program at the site listed below.)

Rhyme is harder -- I haven't yet tried it in English -- precisely
because text-to-phoneme is very hard.

I haven't really worked with this, that is, with the sounds of speech
(though I'm a musician as well as a poet), mostly because it's
difficult. The projects in my *Virtual Muse: Experiments in Computer
Poetry"[1], for example, deal almost entirely with language as a
typographical phenomenon. So does my Scandroid, even though the
material it's working with is all aimed at and motivated by the
auditory qualities of poetry.

I do imagine you're right that the text-to-speech people have worked
out a lot of this. The trouble is that so far I haven't seen
public-domain code for the guts of such a program, which is what you
would need.

Interesting to think about which problems change between French and
English and which do not.

Good luck -- keep me posted.

[1] This was published by Wesleyan Univ Press, what, nine years ago.
Probably out of print. I do know where to get some copies.


Paul Rubin

unread,
Mar 20, 2005, 5:04:15 PM3/20/05
to
Francis Girard <francis...@free.fr> writes:
> 4- Propose a synonym that will fit in a verse, i.e. with the right amount of
> syllabs
>
> 5- Suggest a missing word or expression in a verse by applying the Shannon
> text generation principle
> ...

> First, do you think it may be a useful tool ?
> What other features you think can make it usefull for a poet ?

I'm skeptical of this notion. You can think of writing a poem as
building up a tree structure where there's a root idea you're trying
to express, "branches" in the choices of images/comparisons/etc. that
you use to express the idea, and "leaves" that are the actual words in
the poem. Rhyme means that a left-to-right traversal of the leaves
(i.e. reading the words) results in a pattern with a certain
structure. You're proposing a tool that helps explore the search
space in the nodes near the bottom level of the tree, to find words
with the right characteristics.

I think the constraint of rhyme and meter is best served by widening
the search space at the upper levels of the tree and not the lower
levels. That is, if you've got an image and you don't find rhyming
words for it with easy natural diction, a computerized search for more
and more obscure words to express that image in rhyme is the last
thing you want. Rather, you want to discard the image and choose a
different one to express the idea. That means seeking more images by
mentally revisiting and staying inside the emotion at the center of
poem, a much more difficult thing to do than solving the mere math
problem of finding a string of rhyming words with similar semantics to
a non-rhyming sequence that you already have. But when you find the
right image, the words and rhythm fall into place without additional
effort.

This is why writing good poems is hard, and is also why the results of
doing it well is powerful. I don't think it can be programmed into a
computer using any current notions.

Tim Churches

unread,
Mar 20, 2005, 11:39:45 PM3/20/05
to Steve Holden, pytho...@python.org
Steve Holden wrote:

> Tim Churches wrote:
>> There once was a language called Python...
>>
>> (which is pretty close to having three anapaestic left feet)
>>
>> or more promisingly, rhyme-wise, but metrically rather worse :
>>
>> There once was a mathematician named van Rossum...
>>
>> Tim C
>>
> Of course this last suggestion clearly has the wrong meter for a good
> limerick.

I did say it was metrically worse...

> Not everyone knows the ingredients of a good limerick, which
> led to the following (which has been around in various forms since God
> was a lad):
>
> There was a young man from Japan
> Who never quite learned how to scan.
> He got on quite fine
> Until the last line
> And then somehow he could never quite get the number of syllables
> right,or make it rhyme.

This page on meta-limericks is worth a look:
http://www.kith.org/logos/words/lower/l.html

> So, let's accept that the first line should scan correctly, that would
> make the following first lines acceptable:
>
> A mathematician named Guido ...
> The inventor of Python, called Guido ...
> A mathematician (van Rossum) ...
> Van Rossum, inventor of Python ...
>
> Hopefully that will begin to get the idea across.

The Wikipaedia page on limericks is also worth reading:
http://en.wikipedia.org/wiki/Limericks

> Since it's PyCon week, I will offer a prize of $100 to the best (in my
> opinion) limerick about Python posted to this list (with a Cc: to
> py...@python.org) before midday on Friday. The prize money will be my
> own, so there are no other rules. I will post my judgment when the PyCon
> nonsense has died down a little, but the winner will be read before the
> entire PyCon audience. Get to it!

My first attempt (which does not scan properly):

A Dutch mathematician most prophetic,
Did invent a language, name herpetic.
With design quite intelligent,
And syntax mostly elegant,
Big ideas could be made non-hypothetic.

Tim C


Brian van den Broek

unread,
Mar 21, 2005, 1:52:15 AM3/21/05
to pytho...@python.org, py...@python.org
Steve Holden said unto the world upon 2005-03-20 16:18:

<SNIP>

> Since it's PyCon week, I will offer a prize of $100 to the best (in my
> opinion) limerick about Python posted to this list (with a Cc: to
> py...@python.org) before midday on Friday. The prize money will be my
> own, so there are no other rules. I will post my judgment when the PyCon
> nonsense has died down a little, but the winner will be read before the
> entire PyCon audience. Get to it!
>
> regards
> Steve


Homage to the Interactive Interpreter (with apologies to all the monks
out there):

My dear Guido dared once to combine
Out of objects, command of a line
There was nary a brace.
In their place? Some whitespace!
And cast many their Perl before swine.


(I agree that the idiom played upon in the last line is obverted, but
but plead poetic license :-)

Best to all,

Brian vdB

Paul McGuire

unread,
Mar 21, 2005, 3:10:56 AM3/21/05
to
How about a clerihew instead of a limerick?

Guido van Rossum
Had an idea most awesome.
When he lost track of his braces,
Just replaced them with spaces.

-- Paul McGuire

Miki Tebeka

unread,
Mar 21, 2005, 3:23:02 AM3/21/05
to Charles Hartman, pytho...@python.org
Hello Charles,

> Does anyone know of a cross-platform (OSX and Windows at least) library
> for text-to-speech? I know there's an OSX API, and probably also for
> Windows. I know PyTTS exists, but it seems to talk only to the Windows
> engine. I'd like to write a single Python module to handle this on both
> platforms, but I guess I'm asking too much -- it's too hardware
> dependent, I suppose. Any hints?

Maybe you can bind Festival
(http://www.cstr.ed.ac.uk/projects/festival/download.html) with SWIG.

HTH.
--
------------------------------------------------------------------------
Miki Tebeka <miki....@zoran.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

Charles Hartman

unread,
Mar 21, 2005, 7:55:55 AM3/21/05
to miki....@zoran.com, pytho...@python.org

> Maybe you can bind Festival
> (http://www.cstr.ed.ac.uk/projects/festival/download.html) with SWIG.

Presumably somebody could; at this point it's well beyond me. But thank
you for the suggestion.

Charles Hartman
http://cherry.conncoll.edu/cohar

Martin Franklin

unread,
Mar 21, 2005, 8:08:30 AM3/21/05
to pytho...@python.org

There is tkfestival http://ludios.org/programs/tkfestival that uses
expect to control festival, I assume it has a very easy to use CLI
and would be simple to make use of pexpect to control festival from
python in the same way.

Martin


Francis Girard

unread,
Mar 21, 2005, 11:46:32 AM3/21/05
to pytho...@python.org
This is about poetry. I think the next reply should be done privately unless
someone else is interested in it.

Hi,

Le dimanche 20 Mars 2005 23:04, Paul Rubin a écrit :
> Francis Girard <francis...@free.fr> writes:
> > 4- Propose a synonym that will fit in a verse, i.e. with the right amount
> > of syllabs
> >
> > 5- Suggest a missing word or expression in a verse by applying the
> > Shannon text generation principle
> > ...
> > First, do you think it may be a useful tool ?
> > What other features you think can make it usefull for a poet ?
>
> I'm skeptical of this notion. You can think of writing a poem as
> building up a tree structure where there's a root idea you're trying
> to express, "branches" in the choices of images/comparisons/etc. that
> you use to express the idea, and "leaves" that are the actual words in
> the poem. Rhyme means that a left-to-right traversal of the leaves
> (i.e. reading the words) results in a pattern with a certain
> structure. You're proposing a tool that helps explore the search
> space in the nodes near the bottom level of the tree, to find words
> with the right characteristics.
>
> I think the constraint of rhyme and meter is best served by widening
> the search space at the upper levels of the tree and not the lower
> levels. That is, if you've got an image and you don't find rhyming
> words for it with easy natural diction, a computerized search for more
> and more obscure words to express that image in rhyme is the last
> thing you want.

Absolutly right.

> Rather, you want to discard the image and choose a
> different one to express the idea. That means seeking more images by
> mentally revisiting and staying inside the emotion at the center of
> poem, a much more difficult thing to do than solving the mere math
> problem of finding a string of rhyming words with similar semantics to
> a non-rhyming sequence that you already have.

Again, right. Your description comes very close to my own experience of
writing poems and I never read something as clear as what I'm reading here.
Poetry practice is described most of the time in poetic terms just like
religion is described in religious terms. And one has to impregnate himself
with these words to, little by little, gain some understanding of it. Your
description proves that it is possible to describe it otherwise. I am truly
marvelled.

The question is : how do you discard the image to choose another one ? How
this process takes place ? I observed myself while writing a poem (I, myself,
may not be good example since I am certainly not a good poet) and discovered
that it is while playing with the words, trying to find the right one, with
the right number of syllabs, that I discover a new image, and re-write the
whole verse, even re-arranging the whole strophe or poem. My goal with the
two last tasks (4 and 5) was to help the poor guy struggling with the words,
not to produce the correct final verse, but only to help him in one of the
phase of his writing.

> But when you find the
> right image, the words and rhythm fall into place without additional
> effort.
>

I don't believe much in this. Poetry and writing in general is work, work,
work and more work.

> This is why writing good poems is hard, and is also why the results of
> doing it well is powerful. I don't think it can be programmed into a
> computer using any current notions.

Again right. My goal, of course, is not to substitute the poet by a computer.
Only help him in some of his mechanical tasks.

Regards

Francis Girard

Brian van den Broek

unread,
Mar 21, 2005, 12:04:55 PM3/21/05
to pytho...@python.org
Paul McGuire said unto the world upon 2005-03-21 03:10:

Hi all,

that's pretty good, Paul.

However, I must insist that you both cease and desist.

Your "Allusion to the computational instructional language Python,
through the inclusion of 'brace' (and its derivative forms) and
'space' (and its derivative forms) in a rhyming couplet in a comedic
verse", while quite amusing, is a clear violation of my Intellectual
Property. My Intellectual Property rights are attested to by my extant
prior art <http://tinyurl.com/4bu3n>, the patent application pending
before the Patent Office of The Republic of Freedonia covering same,
and Darl McBride's say-so.

Having drafted a patent application covering the use of 'space' and
'brace' in poetic contexts, I saw no good reason to stop there. Hence,
the pending patent application also covers both the use of braces and
whitespace as delimiters (block or otherwise) in any language or set
of instructions, (natural, computational or otherwise artificial). So,
I must also demand that you, and the rest of the Python community
immediately cease and desist from producing any instructions, in any
language, which employ either of these syntactic constructs to
represent either structure or relations of logical dependency.

Please do note that I make no claim to 'ENDSUB' and like constructs;
insofar as my Intellectual Property rights are concerned, you are free
to employ such constructs, in any linguistic expression, including,
but not limited to, provision of instruction and poetic expression,
regardless of context or language in which they are employed.

A formal statement of my position shall be forthcoming from my
solicitors, the illustrious firm of Dewey, Cheatem, & Howe. I am
optimistic that we will be able to arrive at licencing terms both fair
and equitable.

I remain your most faithful servant,

Brian vdB


Scott David Daniels

unread,
Mar 21, 2005, 12:12:39 PM3/21/05
to
Tim Churches wrote:
> ...

> My first attempt (which does not scan properly):
>
> A Dutch mathematician most prophetic,
> Did invent a language, name herpetic.
> With design quite intelligent,
> And syntax mostly elegant,
> Big ideas could be made non-hypothetic.

To improve the scan:

A mathematician, prophetic,
invented a language, herpetic.
decidedly brilliant,
syntacticly elegant,
Made ideas far less hypothetic.

--Scott David Daniels
Scott....@Acm.Org

Bill Mill

unread,
Mar 21, 2005, 4:16:41 PM3/21/05
to Paul McGuire, pytho...@python.org
On 21 Mar 2005 12:47:07 -0800, Paul McGuire <pt...@austin.rr.com> wrote:
> Brian,
>
> Having reviewed your Cease and Desist petition, I'm afraid I must
> dispute some or all of your claims:
>
> 1. Your citation of prior art has one or more significant defects:
> a. In your citation, "brace" is clearly rhymed with "whitespace", not
> "space". The broad concept of "whitespace" is substantially different
> from the specific term "spaces": "whitespace" encompasses all
> white-printing characters, including tabs, formfeeds, and carriage
> returns, as well as space characters. In the more general field of
> publishing, "whitespace" also includes page margins, paragraph breaks,
> and block indentations for embedded quotes or subsections. In my
> submission, "spaces" is specifically intended to narrowly refer to the
> character defined in ISO 8879 as ASCII code 32. Especially, I did
> *not* intend to include reference to the ISO 8879 ASCII code 9
> character, or "tab".
> b. Prior art predates your citation, see Guido van Rossum's post
> "[marketing-python] How About a Slogan or Tagline?", at
> http://wingware.com/pipermail/marketing-python/2002-March/003851.html,
> which includes several notable references to derivative forms of
> "brace" and "space".
> 2. As the Python language's most salient feature is its usage of spaces
> for program structuring, as opposed to use of enclosing brace
> characters in related scripting languages (Tcl, Perl) and compiled
> languages (C, C++, Java, C#), the juxtaposition of "brace" and "space"
> in any poetic construct is obvious, and this obviousness further erodes
> your IP claim.
> 3. I think my poem was funnier - "lost track of his braces" (humorous
> allusion to suspenders) is a knee-slapper! ("Perl before swine" was
> cute, but it's not new.)
>
> Still, I am open to negotiation - would you be interested in
> cross-licensing my patent pending rhyming of "van Rossum" and
> "awesome"?
>

T'were two coders in c.l.p
Who liked to argue legally
About copyright
All day and night,
Just to prove their inanity

Paul Rubin

unread,
Mar 21, 2005, 2:33:41 PM3/21/05
to
Scott David Daniels <Scott....@Acm.Org> writes:
> A mathematician, prophetic,
> invented a language, herpetic.
> decidedly brilliant,
> syntacticly elegant,

syntactically elegant,
with features intelligent

> Made ideas far less hypothetic.

Made writing new code copasetic.

Paul McGuire

unread,
Mar 21, 2005, 3:47:07 PM3/21/05
to
Brian,

Regards,
-- Paul

Peter Hansen

unread,
Mar 21, 2005, 7:07:20 PM3/21/05
to

Wow... test-driven poetry!

:-)

Peter Hansen

unread,
Mar 21, 2005, 7:09:53 PM3/21/05
to
Bill Mill wrote:
> T'were two coders in c.l.p
> Who liked to argue legally
> About copyright
> All day and night,
> Just to prove their inanity

Nit-picking: Bill, you missed an "s" in that last word...

Bengt Richter

unread,
Mar 21, 2005, 10:42:05 PM3/21/05
to

A fan of Monty and all was Guido,
which inluenced much of what he'd do.
Fun was the name of the game,
or if you need something to blame,
aversions to perl versions,
might be your diversions.
But Guido did concentrate well,
and managed sans line noise to spell.

Suite nothings do our blocks express
which doth our code transparently dress,
delighting the many who view
while confounding a relative few ...
and rightly conferring to Guido much fame,
though Guido van Rossum is only one name.
There's a "this" to import for a hint
why so many contribute a stint.

The beauty, the Zen, the generous ethos attract,
But it's not deniable it's a definite fact
that that really's not explaining it all:
It's a good bet they're having a ball ;-)

Regards,
Bengt Richter

Michael Spencer

unread,
Mar 22, 2005, 8:12:50 PM3/22/05
to pytho...@python.org
How about a category for executable limericks?

Here's one to get the ball rolling:


# voice only the alphanumeric tokens

from itertools import repeat
for feet in [3,3,2,2,3]:
print " ".join("DA-DA-DUM"
for dummy in [None]
for foot in repeat("metric", feet))

Michael


P.S. I know 'three' doesn't rhyme.

Bengt Richter

unread,
Mar 23, 2005, 12:34:32 AM3/23/05
to
On Tue, 22 Mar 2005 03:42:05 GMT, bo...@oz.net (Bengt Richter) wrote:
[...]

>A fan of Monty and all was Guido,
>which inluenced much of what he'd do.
...
Oy. Re-reading => DAPR (Day After Posting Remorse) ;-/
Oh well.

Regards,
Bengt Richter

Peter Hansen

unread,
Mar 22, 2005, 11:36:15 PM3/22/05
to
Michael Spencer wrote:
> How about a category for executable limericks?
>
> Here's one to get the ball rolling:
>
> # voice only the alphanumeric tokens
>
> from itertools import repeat
> for feet in [3,3,2,2,3]:
> print " ".join("DA-DA-DUM"
> for dummy in [None]
> for foot in repeat("metric", feet))

Brilliant! +10

My nomination to this one for originality,
perfect meter (unlike many others posted so
far), and best of all for the fact that
it is not only a limerick on two levels
(run it for real or mentally and read the
output aloud), but its topic is also
self-referentially about limericks.

> P.S. I know 'three' doesn't rhyme.

That's allowed since you're distributing this
(may I presume?) under the Poetic License. ;-)

-Peter

David Fraser

unread,
Mar 23, 2005, 3:14:49 AM3/23/05
to py...@python.org
Michael Spencer wrote:
> How about a category for executable limericks?
>
That was my thought too...

for programmer in search_of("elegance"):
if programmer.needs("an experience"):
print "whitespace counts much"
if Van_Rossum is Dutch:
print "Dictators are made by benevolence"

And an attempt at a self-replicating one that uses far too many
syllables in the last line:

rhymes = 'for line in ["rhymes", "fines"]:\n '
fines = 'print line, "=", `eval(line)`\n'
for line in ["rhymes", "fines"]:
print line, "=", `eval(line)`
whine='whine=%s;print rhymes, fines, whine%%`whine`';print rhymes,
fines, whine%`whine`

This can actually be pronounced as a proper limerick as follows: always
pronounce = as "is" and ; as "so", don't pronounce any other
punctuation, and cheat by pronouncing the first string in the last line
as "junk" :-)

rhymes is for line in rhymes fines
fines is print line is eval line
for line in rhymes fines
print line is eval line
whine is junk so print rhymes fines whine whine

David

Richie Hindle

unread,
Mar 23, 2005, 7:02:51 AM3/23/05
to pytho...@python.org

[Michael]

> from itertools import repeat
> for feet in [3,3,2,2,3]:
> print " ".join("DA-DA-DUM"
> for dummy in [None]
> for foot in repeat("metric", feet))

Spectacular! +1 QOTW

--
Richie Hindle
ric...@entrian.com

smitty_one_each

unread,
Mar 24, 2005, 12:13:16 PM3/24/05
to

Well, don't be so harsh on yourself.
You get a weak correlation between the 'ee' in 3 and the ('eat','eet')
tuple, based on assonance.
Good work.

0 new messages