keyword checker - keyword.kwlist



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 + "is keyword"

else:
print input + "is not keyword"
.



Relevant Pages

  • Re: keyword checker - keyword.kwlist
    ... On 10 Mag, 15:38, t...@xxxxxxxxxxx wrote: ... I try to check whether a given input is keyword or not. ... script won't identify keyword input as a keyword. ... print input + "is not keyword" ...
    (comp.lang.python)
  • RE: keyword checker - keyword.kwlist
    ... I try to check whether a given input is keyword or not. ... script won't identify keyword input as a keyword. ... How should I modify it ... print input + "is not keyword" ...
    (comp.lang.python)
  • Re: keyword checker - keyword.kwlist
    ... I try to check whether a given input is keyword or not. ... script won't identify keyword input as a keyword. ... How should I modify it ...
    (comp.lang.python)
  • Re: Attempt to execute script radon as a function
    ... radon.m starts with a the function keyword. ... Radon function which is a part of image processing toolbox. ... "Attempt to execute script radon as a function in line number..." ...
    (comp.soft-sys.matlab)
  • Re: read text file
    ... I'm a Filemaker newbie. ... (one keyword per line), search each keyword in certain fields ... You would script a loop through all of the records in the Keyword ... create another field in Gene to set as a flag if the word is there. ...
    (comp.databases.filemaker)