question about python statements

George Sakkis george.sakkis at gmail.com
Mon May 12 21:16:01 EDT 2008


On May 12, 7:35 pm, "Terry Reedy" <tjre... at udel.edu> wrote:
> "Ohad Frand" <ohad.fr... at percello.com> wrote in message
>
> news:B9E129828E47994B9B95E1BAABC8868C0B8F06 at percello-sbs.percello.local...
> | I am looking for a way to programmically get a list of all python
> | existing statements that I cannot access by __builtins__ or locals()
> | (like ["assert","break","class",...])
>
> You appear to want the keywords that begin statements.  Look at the keyword
> list in the language reference and pick those you want.  Then build that
> list into your program.

Someone already did it:

import keyword
print keyword.kwlist

George



More information about the Python-list mailing list