how to insert random error in a programming

Chris Angelico rosuav at gmail.com
Mon Oct 15 10:04:49 EDT 2012


On Tue, Oct 16, 2012 at 12:55 AM, Debashish Saha <silideba at gmail.com> wrote:
> how to insert random error in a programming?

how to ask question good in forumming?
http://www.catb.org/~esr/faqs/smart-questions.html

But here's one way to do it:

raise random.choice((OSError,IOError,ZeroDivisionError,UnicodeDecodeError,AssertionError))()

ChrisA



More information about the Python-list mailing list