Re: keyword checker - keyword.kwlist

2007-05-12 Thread tom
[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. > >

Re: keyword checker - keyword.kwlist

2007-05-12 Thread tom
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

Re: keyword checker - keyword.kwlist

2007-05-10 Thread Gabriel Genellina
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

Re: keyword checker - keyword.kwlist

2007-05-10 Thread tom
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

RE: keyword checker - keyword.kwlist

2007-05-10 Thread Hamilton, William
> 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

Re: keyword checker - keyword.kwlist

2007-05-10 Thread Peter Otten
[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

Re: keyword checker - keyword.kwlist

2007-05-10 Thread tom
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

Re: keyword checker - keyword.kwlist

2007-05-10 Thread Sion Arrowsmith
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

Re: keyword checker - keyword.kwlist

2007-05-10 Thread Steven D'Aprano
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

RE: keyword checker - keyword.kwlist

2007-05-10 Thread Hamilton, William
> 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 >> '

Re: keyword checker - keyword.kwlist

2007-05-10 Thread tom
> > 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

Re: keyword checker - keyword.kwlist

2007-05-10 Thread alessiogiovanni . baroni
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

keyword checker - keyword.kwlist

2007-05-10 Thread tom
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