Python get's a mention on University Challenge

Gerrit Holl gerrit at nl.linux.org
Tue Jun 3 17:38:04 EDT 2003


Jack Diederich schreef op dinsdag  3 juni om 04:17:26 +0000:
> def believer_pray(text):
>   """this function always succeeds"""
>   open('/dev/god', 'w').write(text)

>>> believer_pray("Let the Brave PEPs go to Heaven and Let the Sinful PEPs burn in hell for eternity...")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "pray.py", line 3, in believer_pray
    open('/dev/god', 'w').write(text)
IOError: [Errno 13] Permission denied: '/dev/god'

As always, the untouchables are not allowed to pray...

Maybe open('/dev/null', 'w') would be a better implementation :P

yours,
Gerrit.





More information about the Python-list mailing list