Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #3987
| From | Mel <mwilson@the-wire.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Input() in Python3 |
| Followup-To | comp.lang.python |
| Date | 2011-04-25 12:50 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <ip48p8$q0r$1@speranza.aioe.org> (permalink) |
| References | <I89sp.39115$yp3.5013@newsfe09.iad> <BANLkTimJ3ZXNK_0jk_yeinmUNo8s1aQfSw@mail.gmail.com> <mailman.746.1303480346.9059.python-list@python.org> <ios24t$k72$1@speranza.aioe.org> <mailman.782.1303587241.9059.python-list@python.org> |
Followups directed to: comp.lang.python
Westley Martínez wrote:
> On Fri, Apr 22, 2011 at 10:08:20AM -0400, Mel wrote:
[ ... ]
>> But sys.exit() doesn't return a string. My fave is
>>
>> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
>> [GCC 4.4.3] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import sys
>> >>> a = int (input ('enter a number >'))
>> enter a number >sys.setrecursionlimit(1)
>> Exception RuntimeError: 'maximum recursion depth exceeded while calling a
>> Python object' in <type 'exceptions.RuntimeError'> ignored
[ ... ]
> What?
I guess sys.setrecursionlimit was meant to be called with a large number.
Calling it with a small one roadblocks the interpreter. Luckily, there can
be just enough room to call setrecursionlimit again with something
reasonable to get it all back. Not enough room for `eval
("sys.setrecursionlimit (2000)`, though.
Mel.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar
Input() in Python3 harrismh777 <harrismh777@charter.net> - 2011-04-22 01:22 -0500
Re: Input() in Python3 Chris Angelico <rosuav@gmail.com> - 2011-04-22 16:49 +1000
Re: Input() in Python3 Chris Angelico <rosuav@gmail.com> - 2011-04-22 16:50 +1000
Re: Input() in Python3 Chris Rebert <clp2@rebertia.com> - 2011-04-22 00:46 -0700
Re: Input() in Python3 harrismh777 <harrismh777@charter.net> - 2011-04-23 20:03 -0500
Re: Input() in Python3 Westley Martínez <anikom15@gmail.com> - 2011-04-22 06:52 -0700
Re: Input() in Python3 Mel <mwilson@the-wire.com> - 2011-04-22 10:08 -0400
Re: Input() in Python3 Chris Angelico <rosuav@gmail.com> - 2011-04-23 06:25 +1000
Re: Input() in Python3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-22 23:55 +0000
Re: Input() in Python3 Chris Angelico <rosuav@gmail.com> - 2011-04-23 10:07 +1000
Re: Input() in Python3 Westley Martínez <anikom15@gmail.com> - 2011-04-23 12:33 -0700
Re: Input() in Python3 Mel <mwilson@the-wire.com> - 2011-04-25 12:50 -0400
csiph-web