Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #31323
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:faqs': 0.09; 'subject:error': 0.11; 'oct': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:r 80': 0.16; 'subject:programming': 0.16; 'subject:random': 0.16; 'url:catb': 0.16; 'url:~esr': 0.16; 'wrote:': 0.17; 'insert': 0.23; 'raise': 0.24; 'random': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'question': 0.27; 'header:X -Complaints-To:1': 0.28; 'chris': 0.28; 'error': 0.30; 'to:addr :python-list': 0.33; 'something': 0.35; 'received:org': 0.36; 'but': 0.36; 'url:org': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Serhiy Storchaka <storchaka@gmail.com> |
| Subject | Re: how to insert random error in a programming |
| Date | Mon, 15 Oct 2012 20:18:10 +0300 |
| References | <CA+b=61AiVYehyGbFyvyTqsfZeio1NoWKtw1SwJV_r_MZ1BcVwA@mail.gmail.com> <CAPTjJmpK1edyzOdORPyv8M_WCzgqzcJwRJG2pTb2j-d85ANEUA@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | 37.115.213.25 |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 |
| In-Reply-To | <CAPTjJmpK1edyzOdORPyv8M_WCzgqzcJwRJG2pTb2j-d85ANEUA@mail.gmail.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2222.1350321510.27098.python-list@python.org> (permalink) |
| Lines | 16 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1350321510 news.xs4all.nl 6878 [2001:888:2000:d::a6]:57394 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:31323 |
Show key headers only | View raw
On 15.10.12 17:04, Chris Angelico wrote: > On Tue, Oct 16, 2012 at 12:55 AM, Debashish Saha <silideba@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))() I think OP means something like programming[:0] = random.choice((OSError,IOError,ZeroDivisionError,UnicodeDecodeError,AssertionError))()
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: how to insert random error in a programming Serhiy Storchaka <storchaka@gmail.com> - 2012-10-15 20:18 +0300
csiph-web