Python get's a mention on University Challenge

Jack Diederich jack at performancedrivers.com
Mon Jun 2 22:14:06 EDT 2003


On Tue, Jun 03, 2003 at 01:54:32PM +1200, Greg Ewing (using news.cis.dfn.de) wrote:
> Phil Thompson wrote:
> > Maybe prayer should be added as a transport to Twisted?
> 
> Should be simple enough:
> 
> def pray(text):
>    open("/dev/god", "w").write(text)

Your program makes some assumptions, other programmers might prefer these
to fit their personal style.

def atheistic_pray(text):
  os.system('mknod /dev/god') # we have to do this ourselves
  open('/dev/god', 'w').write(text)

def agnostic_pray(text):
  try:
    open('/dev/god', 'w').write(text)
  except: pass

def believer_pray(text):
  """this function always succeeds"""
  open('/dev/god', 'w').write(text)

-jack


    
    





More information about the Python-list mailing list