[EMAIL PROTECTED] kirjoitti:
> Gabriel Genellina kirjoitti:
>> En Thu, 10 May 2007 17:03:13 -0300, <[EMAIL PROTECTED]> escribió:
>> my_input = raw_input("...").strip()
>>
>> as Peter Otten suggested before
>>
>> --Gabriel Genellina
>>
> Ok, it seems to work with strip(). Thanks for your help.
>
>
Gabriel Genellina kirjoitti:
> En Thu, 10 May 2007 17:03:13 -0300, <[EMAIL PROTECTED]> escribió:
> my_input = raw_input("...").strip()
>
> as Peter Otten suggested before
>
> --Gabriel Genellina
>
Ok, it seems to work with strip(). Thanks for your help.
Do you guys have any clue why mine previo
En Thu, 10 May 2007 17:03:13 -0300, <[EMAIL PROTECTED]> escribió:
> I tried the trick but the error stays. I really don't know what to do
> anymore.
>
> And what about the print function. Why does it print newline even if
> there is colon after variable? I'm lost.
>
> I'm using Eclipe enviroment a
Hamilton, William kirjoitti:
>> From: [EMAIL PROTECTED]
>> F:\Ohjelmat\Python25\Lib\keyword.pyc
>
> That's your problem. Rename keyword.py to keywordcheck.py, and delete
> keyword.pyc in this directory, and it should work fine.
>
> ---
> -Bill Hamilton
I tried the trick but the error stays. I re
> From: [EMAIL PROTECTED]
> F:\Ohjelmat\Python25\Lib\keyword.pyc
That's your problem. Rename keyword.py to keywordcheck.py, and delete
keyword.pyc in this directory, and it should work fine.
---
-Bill Hamilton
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Still no go. I just can't get it right. My current script:
>
> #!usr/bin/env python
> import keyword
>
> myInput = raw_input('Enter identifier to check >> ')
> if myInput in keyword.kwlist:
> print myInput, "is keyword"
>
> else:
> print myInput, "is not ke
Still no go. I just can't get it right. My current script:
#!usr/bin/env python
import keyword
myInput = raw_input('Enter identifier to check >> ')
if myInput in keyword.kwlist:
print myInput, "is keyword"
else:
print myInput, "is not keyword"
print keyword.kwlist
print keyword.__file
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote:
[ ... ]
>> Try to change the 'input' variable name with other...
>Changed input variable to myInput, but the result is still the same.
That was good advice, but isn't going to help here. Because "input"
isn't a keyword, it's a builtin. If
On Thu, 10 May 2007 13:38:40 +, tom wrote:
> Hi
>
> I try to check whether a given input is keyword or not. However this
> script won't identify keyword input as a keyword. How should I modify it
> to make it work?
It works for me.
Try printing keyword.__file__ to make sure you are impor
> From: [EMAIL PROTECTED]
>
> Hi
>
> I try to check whether a given input is keyword or not. However this
> script won't identify keyword input as a keyword. How should I modify it
> to make it work?
>
> #!usr/bin/env python
> import keyword
>
> input = raw_input('Enter identifier to check >> '
>
> Hmm... I tried, and identify it.
> Try to change the 'input' variable name with other...
>
Changed input variable to myInput, but the result is still the same.
for example, 'else' isn't identified as a keyword by the script though
it exists in keyword.kwlist.
--
http://mail.python.org/mail
On 10 Mag, 15:38, [EMAIL PROTECTED] wrote:
> Hi
>
> I try to check whether a given input is keyword or not. However this
> script won't identify keyword input as a keyword. How should I modify it
> to make it work?
>
> #!usr/bin/env python
> import keyword
>
> input = raw_input('Enter identifier to
Hi
I try to check whether a given input is keyword or not. However this
script won't identify keyword input as a keyword. How should I modify it
to make it work?
#!usr/bin/env python
import keyword
input = raw_input('Enter identifier to check >> ')
if input in keyword.kwlist:
print input
13 matches
Mail list logo