[Tutor] Is input a Python function or command?

Nathan Pinno falcon3166 at hotmail.com
Mon Aug 1 08:25:45 CEST 2005


Just remembered that input is for integers! Oops! Shouldn't have asked! And 
in_file makes more sense because I'm loading a file with it.
----- Original Message ----- 
From: "Nathan Pinno" <falcon3166 at hotmail.com>
To: "Luke P" <rabidpoobear at gmail.com>
Cc: "Tutor mailing list" <tutor at python.org>
Sent: Sunday, July 31, 2005 8:05 PM
Subject: Re: [Tutor] Is input a Python function or command?


> Thanks Luke. Saved me quite a headache. I will use in_file instead. Makes
> more sense anyway.
> ----- Original Message ----- 
> From: "luke p" <rabidpoobear at gmail.com>
> To: "Nathan Pinno" <falcon3166 at hotmail.com>
> Sent: Sunday, July 31, 2005 7:59 PM
> Subject: Re: [Tutor] Is input a Python function or command?
>
>
> why do you want to use input as a variable?
>
> did you try testing it on the interactive prompt?
>>>> input
> (built-in function input)
>>>>hello = "test"
>>>>input()
> hello
> "test"
>
> so yep it's a builtin function.
>
> try to come up with more explanatory names.
> or just name all your variables "tmp" and "temp" and "x".
>
> or you can just overwrite the input function n the namespace.
>
> I'm sure some people would consider these approaches evil, however, so
> you probably shouldn't do it unless your code is for your use only.
>
> HTH,
> Luke
>
>
> On 7/31/05, Nathan Pinno <falcon3166 at hotmail.com> wrote:
>> Is input a Python function or command? I need to know because I'm 
>> planning
>> to use it as a variable, and don't want to get an error.
>>
>> Thanks,
>> Nathan
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>>
>>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


More information about the Tutor mailing list