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
Hello,
I on working on windows and Python 2.4. Where can I find and CHANGE
python
grammar. ( I just want to change the keywords )
PLEASE HELP ME
SOMEBODY!!
THANKS!
--
http://mail.python.org/mailman/listinfo/python-lis
Hello,
I on working on windows and Python 2.4. Where can I find and CHANGE python
grammar. ( I just want to change the keywords )
PLEASE HELP ME
SOMEBODY!!
THANKS!
__
[EMAIL PROTECTED] escribió:
> Hello again,
>
> Thanks for everything previously, I was change the grammar and Lib/
> keyword.py, now
> Python recognize "koristiti" as a keyword, but that is not enough:
>
> when I write in my python shell:
>
koristiti os # "koristiti" get
[EMAIL PROTECTED] schrieb:
> Hello,
>
> I am trying to make a program for 3D modelling with "programming".And
> I want make my own program commands,
>
> for example when user type code in my program:
>
> "<> OS"- (THIS IS MY IMAGINARY EXAMPLE OF KEYWORD),
>
> my program must write this code in
Hello again,
Thanks for everything previously, I was change the grammar and Lib/
keyword.py, now
Python recognize "koristiti" as a keyword, but that is not enough:
when I write in my python shell:
>>> koristiti os # "koristiti" get keyword "color", but I get
>>> error:
File
he import of any Python module written for the standard keywords --
> such as many of those in the standard library?
Most certainly, yes.
> My understanding of the original poster's requirement was that the
> keywords should be additional to, not replacement for, the existing
>
ged in the Python executable, won't that break
the import of any Python module written for the standard keywords --
such as many of those in the standard library?
My understanding of the original poster's requirement was that the
keywords should be additional to, not replacement for, the
> "<> OS"- (THIS IS MY IMAGINARY EXAMPLE OF KEYWORD),
>
> my program must write this code in some user file, but my
>
> program must read this command like: "import os".How
>
> can I do something like that??
The keywords are listed in Grammar/Grammar. You need to edit
this file, then recompile
[EMAIL PROTECTED] je napisao/la:
> I'm not quite clear on what you are asking, but
> you can use the __import__() function to import modules by name.
>
I want to invent something like my "programming language" like Python
with the same keywords just changed,
for example if user type in my "progr
I'm not quite clear on what you are asking, but
you can use the __import__() function to import modules by name.
On Jun 21, 3:07 pm, [EMAIL PROTECTED] wrote:
> Hello,
>
> I am trying to make a program for 3D modelling with "programming".And
> I want make my own program commands,
>
> for example wh
Hello,
I am trying to make a program for 3D modelling with "programming".And
I want make my own program commands,
for example when user type code in my program:
"<> OS"- (THIS IS MY IMAGINARY EXAMPLE OF KEYWORD),
my program must write this code in some user file, but my
program must read this
gtb <[EMAIL PROTECTED]> wrote:
> Have done some searching but have not found a place where I can look
> up python keywords.
>>> import keyword
>>> keyword.kwlist
['and', 'as', 'assert', 'break', 'class',
On Apr 26, 1:59 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of gtb
> > Sent: Thursday, April 26, 2007 1:50 PM
> > To: [EMAIL PROTECT
Thanks Marc.
--
http://mail.python.org/mailman/listinfo/python-list
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:python-
> [EMAIL PROTECTED] On Behalf Of gtb
> Sent: Thursday, April 26, 2007 1:50 PM
> To: python-list@python.org
> Subject: Re: Python keywords
>
> On Apr 26, 10:16 am, Larry Bates <[EMAIL
On Apr 26, 10:16 am, Larry Bates <[EMAIL PROTECTED]> wrote:
> gtb wrote:
> > Have done some searching but have not found a place where I can look
> > up python keywords. I was looking at a script that contained the
> > following line:
>
> > assert self.getRespo
In <[EMAIL PROTECTED]>, gtb wrote:
> Have done some searching but have not found a place where I can look
> up python keywords. I was looking at a script that contained the
> following line:
>
> assert self.getResponseCode() in (200, 304, 302)
>
> I can infer the usag
gtb wrote:
> Have done some searching but have not found a place where I can look
> up python keywords. I was looking at a script that contained the
> following line:
>
> assert self.getResponseCode() in (200, 304, 302)
>
> I can infer the usage here but previously I had
Have done some searching but have not found a place where I can look
up python keywords. I was looking at a script that contained the
following line:
assert self.getResponseCode() in (200, 304, 302)
I can infer the usage here but previously I had thought that "in" was
only used with
In article <[EMAIL PROTECTED]>,
Boris Borcic <[EMAIL PROTECTED]> wrote:
> Roy Smith wrote:
> > and all three keywords are verbs, so when you describe the code, you can
> > use the same English words as in the program source, "You try to execute
> > some code, but it throws a foo, which is caug
Roy Smith wrote:
> I noticed something interesting today. In C++, you write:
>
> try {
>throw foo;
> } catch {
> }
>
> and all three keywords are verbs, so when you describe the code, you can
> use the same English words as in the program source, "You try to execute
> some code, but it thr
defcon8 wrote:
> 1. Does it matter?
> 2. Is it affecting your productivity.
> 3. Are you not trying to programme?
> 4. It is open source, change it and stop whining.
>
What about trying emacs +x doctor ?
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]
1. Does it matter?
2. Is it affecting your productivity.
3. Are you not trying to programme?
4. It is open source, change it and stop whining.
--
http://mail.python.org/mailman/listinfo/python-list
Roy Smith wrote:
> try {
>throw foo;
> } catch {
> }
> try:
>raise foo
> except:
But which one is prettier? ;)
--
http://mail.python.org/mailman/listinfo/python-list
Roy Smith wrote:
> I noticed something interesting today. In C++, you write:
>
> try {
>throw foo;
> } catch {
> }
>
> and all three keywords are verbs, so when you describe the code, you can
> use the same English words as in the program source, "You try to execute
> some code, but it thr
I'm not a english speaker, so I just accepted it...;
I understood it as :
'Try' allways to execute this code, 'except' when it doesn't work do
this
> I noticed something interesting today. In C++, you write:
>
> try {
>throw foo;
> } catch {
> }
>
> and all three keywords are verbs, so
I noticed something interesting today. In C++, you write:
try {
throw foo;
} catch {
}
and all three keywords are verbs, so when you describe the code, you can
use the same English words as in the program source, "You try to execute
some code, but it throws a foo, which is caught by the han
36 matches
Mail list logo