On Apr 10, 4:28 am, candide wrote:
> Python is very good at introspection, so I was wondering if Python (2.7)
> provides any feature to retrieve the list of its keywords (and, as,
> assert, break, ...).
>>> import keyword
>>> keyword.kwlist
['and', 'as', 'assert', 'break', 'class', 'continue', 'd
On 4/10/2011 5:12 AM, candide wrote:
Le 10/04/2011 04:01, Terry Reedy a écrit :
Yes. (Look in the manuals,
I did : my main reference book is the Martelli's /Python in a Nutshell/
You should only use that as a supplement.
and the index doesn't refer to the keyword import
and now you kno
Le 10/04/2011 04:01, Terry Reedy a écrit :
Yes. (Look in the manuals,
I did : my main reference book is the Martelli's /Python in a Nutshell/
and the index doesn't refer to the keyword import
or try the obvious imports ;-)
The only obvious I saw was sys module.
--
http://mail.python
Le 10/04/2011 04:09, John Connor a écrit :
Actually this is all it takes:
import keywords
print keywords.kwlist
>>> import keywords
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named keywords
>>>
so I considered first it was a joke ! ;) In fact the import
On Sun, 10 Apr 2011 03:28:10 +0200, candide wrote:
> Python is very good at introspection, so I was wondering if Python (2.7)
> provides any feature to retrieve the list of its keywords (and, as,
> assert, break, ...).
import keyword
--
Steven
--
http://mail.python.org/mailman/listinfo/python
Actually this is all it takes:
import keywords
print keywords.kwlist
--jac
On Sat, Apr 9, 2011 at 8:57 PM, Chris Angelico wrote:
> On Sun, Apr 10, 2011 at 11:28 AM, candide wrote:
>> Python is very good at introspection, so I was wondering if Python (2.7)
>> provides any feature to retrieve the
On 4/9/2011 9:28 PM, candide wrote:
Python is very good at introspection, so I was wondering if Python (2.7)
provides any feature to retrieve the list of its keywords (and, as,
assert, break, ...).
Yes. (Look in the manuals, or try the obvious imports ;-)
--
Terry Jan Reedy
--
http://mail.pyt
On Sun, Apr 10, 2011 at 11:28 AM, candide wrote:
> Python is very good at introspection, so I was wondering if Python (2.7)
> provides any feature to retrieve the list of its keywords (and, as, assert,
> break, ...).
I don't know about any other way, but here's a really REALLY stupid
method. For
Python is very good at introspection, so I was wondering if Python (2.7)
provides any feature to retrieve the list of its keywords (and, as,
assert, break, ...).
--
http://mail.python.org/mailman/listinfo/python-list