Overheard at the TriLUG meeting

Interesting:

evilaptop: Dude, CHICKS DIG UNIX evilaptop: Everyone knows that evilaptop: Right?? JasonF: that’s almost as unattractive as someone who scripts festival to sing “99 bottles of beer on the wall” at a party

Funny how a lot of the attendees were also chatting on #trilug! hehehe

What??? You’re actually interested in how to do it??? Ok, ok… The source code was also provided! hehehehe

  1. #!/usr/bin/python
  2. # 99 bottles of beer on the wall.
  3. # Inspired by (who’d of thunk) beer!
  4. from os import popen
  5. from time import sleep
  6. def printsay(sometext):
  7. print sometext
  8. voicehandle.write("(SayText ""+sometext+"")")
  9. # Start talkin' you varmint!
  10. voicehandle.flush()
  11. # It’d be nice if festival would tell us when it’s done talking.
  12. sleep(3)
  13. # 2 bottles, 1 bottle, no bottles
  14. def pluralize(somenumber,sometext):
  15. if ( somenumber > 1 ):
  16. retval = str(somenumber)+" "+sometext+"s"
  17. if ( somenumber == 1):
  18. retval = str(somenumber)+" "+sometext
  19. if ( somenumber == 0):
  20. retval = "No "+sometext+"s"
  21. return retval
  22. # Open up a pipe to festival so we don’t keep respawning
  23. voicehandle = popen("festival","w")
  24. # Start with 99 bottles
  25. num_bottles = 99
  26. # Do what now?
  27. refrain = "Take one down, pass it around."
  28. # As long as there’s beer, we drink!
  29. while ( num_bottles > 0 ):
  30. printsay(pluralize(num_bottles,"bottle")+" of beer on the wall.")
  31. printsay(pluralize(num_bottles,"bottle")+" of beer.")
  32. printsay(refrain)
  33. num_bottles = num_bottles - 1
  34. printsay(pluralize(num_bottles,"bottle")+" of beer on the wall.")
  35. print "—-"

Update:  Got to meet Daniel T Chen at the end of the meeting.  What a great guy!  Hope to see him soon again!

Tags
comments powered by Disqus