[Tutor] Input handling?

Dave Angel d at davea.name
Tue Sep 18 08:33:13 CEST 2012

On 09/18/2012 02:12 AM, Steven D'Aprano wrote:
> On Tue, Sep 18, 2012 at 12:04:22AM -0400, Dave Angel wrote:
>> On 09/17/2012 11:11 PM, Scott Yamamoto wrote:
>>> I've been trying to find possible erros with input(such as NameError or SyntaxError) to handle them with an except clause. however, I've found that hitting enter/return while prompted without inputting creates some kind of problem.
>>>>>> username = raw_input("Input a username: ")
>>> Input a username: #hits enter, encounter problem here. Loops forever or something
>>> Using python for ios
>> Somehow you managed to put your other message in its own thread, instead
>> of adding to this one.
> Not all mail clients support threading, either when receiving or 
> sending.
> But my mail client, mutt, shows Scott's emails threaded correctly. 
> Perhaps your mail client is broken? What are you using?

I'm using Thunderbird 14 on Linux, and I'd love help in diagnosing why
some messages get properly threaded, and some do not.  For example, I've
seen several of your replies (not a very big fraction) apparently start
new threads.  And I've seen many other messages which didn't get in the
proper place in the thread, appearing at the same level as the message
they were replies to.

I will be upgrading to latest Thunderbird, but I'm planning on
installing a new Linux on a new hard disk, and haven't really gotten
started yet.

>> What version of Python are you running?  If it's 2.x, and if you're
>> using input(),
> Given that the OP clearly shows
> username = raw_input("Input a username: ")
> I think that we can safely assume that he is not using 2.x's input :)

His first message showed one line, typed in the interpreter, with no
clear statement of environment or problem.  However, the statement did
mention the input function.  I'd have disbelieved it except that...

His second message specifically changes to input.  Here it is again, for
our confusion:

"""Didnt show up at first. Result was an eof error (using input not raw_input)
Found with interactive interpreter

I would have been replying to that one, except that it apparently
started a new thread, as did his third message.  That third one went
back to using raw_input, but it was a reply to my message stating the
hazards of input on Python 2.x



More information about the Tutor mailing list