question about python statements
Terry Reedy
tjreedy at udel.edu
Mon May 12 22:38:10 EDT 2008
"George Sakkis" <george.sakkis at gmail.com> wrote in message
news:e0ea51fe-7279-434b-9e21-c15554624003 at 2g2000hsn.googlegroups.com...
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
=========================
I forgot about that. However, I got the impression that the OP wants a
subset, and if so, *that* will require hand selection.
More information about the Python-list
mailing list