On Aug 30, 1:39 pm, Roy Smith wrote:
> Oh, my, it turns out that django includes:
>
> # This is a copy of the Pythonlogging.config.dictconfig module,
> # reproduced with permission. It is provided here for backwards
> # compatibility for Python versions prior to 2.7.
>
> Comparing the django copy
On Aug 30, 1:39 pm, Roy Smith wrote:
> Oh, my, it turns out that django includes:
>
> # This is a copy of the Pythonlogging.config.dictconfig module,
> # reproduced with permission. It is provided here for backwards
> # compatibility for Python versions prior to 2.7.
>
> Comparing the django copy
On Aug 30, 1:39 pm, Roy Smith wrote:
> Oh, my, it turns out that django includes:
>
> # This is a copy of the Pythonlogging.config.dictconfig module,
> # reproduced with permission. It is provided here for backwards
> # compa
In article ,
Peter Otten <__pete...@web.de> wrote:
> Roy Smith wrote:
>
> > I'm using django 1.3 and python 2.6.
>
> Isn't dictConfig() new in 2.7? It looks like that is what you are using...
Oh, my, it turns out that django includes:
# This is a copy of the Python logging.config.dictconfig m
Hi,
I took a look at the logging source code. getLogger checks for existing
loggers with the given name and if it doesn't creates one.
def getLogger(self, name):
"""
Get a logger with the specified name (channel name), creating it
if it doesn't yet exist. This name is
Roy Smith wrote:
> I'm using django 1.3 and python 2.6.
Isn't dictConfig() new in 2.7? It looks like that is what you are using...
> My logging config is:
>
>
> LOGGING = {
> 'version': 1,
> 'disable_existing_loggers': False,
> 'formatters': {
> 'verbose': {
> '
I'm using django 1.3 and python 2.6.
My logging config is:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(asctime)s: %(name)s %(levelname)s %
(funcName)s %(message)s'
}
},
'handlers':
Ryan J Nauman wrote:
>Can someone help me understand this script please?
>I understand everything except for the anagram function. Could you break
>it down into more than 1 line of code for me or explain it? (I understand
>WHAT it does but HOW?) Thanks.
>
>Script >&g
Can someone help me understand this script please?
I understand everything except for the anagram function. Could you break
it down into more than 1 line of code for me or explain it? (I understand
WHAT it does but HOW?) Thanks.
Script >>
###
# SCRABBLE.PY
#
# purpose:
# find
James Stroud a écrit :
> Beej wrote:
> (2).__add__(1)
>
> Nice. I would have never thought to put parentheses around an integer to
> get at its attributes.
>
> James
You can also do it like that :
>>> 2 .__add__(1)
3
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 30, 9:52 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> A float is, too. 2.__add is a float followed by an identifier.
> Not legal. As pointed out elsewhere in the thread, (2). forces
> it to be an integer followed by a ".".
Which leads to these two beauties:
>>> (2.).__add__(1)
3.
On Jan 30, 1:38 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Because 2. is the start of a float-literal. That isn't distinguishable for
> the parsere otherwise.
Oh, excellent! I wonder why I didn't think of that--I was too busy in
"get a field" mode it didn't even occur to me that the "."
On 2007-01-30, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> En Tue, 30 Jan 2007 06:34:01 -0300, Beej <[EMAIL PROTECTED]> escribió:
>
>> But here's one I still don't get:
>>
> type(2)
>>
> type((2))
>>
> (2).__add__(1)
>> 3
> 2.__add__(1)
>> File "", line 1
>> 2.__add__(1)
In <[EMAIL PROTECTED]>, Jean-Paul
Calderone wrote:
>>An integer is a primary so 2.__add(1) should be valid.
>
> A float is, too. 2.__add is a float followed by an identifier.
> Not legal. As pointed out elsewhere in the thread, (2). forces
> it to be an integer followed by a ".".
A space betwe
On Tue, 30 Jan 2007 14:39:28 -0300, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>En Tue, 30 Jan 2007 06:34:01 -0300, Beej <[EMAIL PROTECTED]> escribió:
>
>> But here's one I still don't get:
>>
> type(2)
>>
> type((2))
>>
> (2).__add__(1)
>> 3
> 2.__add__(1)
>> File "", line 1
En Tue, 30 Jan 2007 06:34:01 -0300, Beej <[EMAIL PROTECTED]> escribió:
> But here's one I still don't get:
>
type(2)
>
type((2))
>
(2).__add__(1)
> 3
2.__add__(1)
> File "", line 1
> 2.__add__(1)
> ^
> SyntaxError: invalid syntax
It appears to be a bug, eit
Beej wrote:
(2).__add__(1)
Nice. I would have never thought to put parentheses around an integer to
get at its attributes.
James
--
http://mail.python.org/mailman/listinfo/python-list
Beej wrote:
> On Jan 29, 11:47 pm, Steven D'Aprano
> <[EMAIL PROTECTED]> wrote:
>> Outside of a print statement (and also an "except" statement), commas
>> create tuples.
>
> And function calls:
>
3,
> (3,)
type(3,)
>
type((3,))
>
>
> But here's one I still don't get:
>
t
On Jan 29, 11:47 pm, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Outside of a print statement (and also an "except" statement), commas
> create tuples.
And function calls:
>>> 3,
(3,)
>>> type(3,)
>>> type((3,))
But here's one I still don't get:
>>> type(2)
>>> type((2))
>>> (2).__add__(1
On Mon, 29 Jan 2007 23:05:37 -0800, ArdPy wrote:
> Hi,
>
> Pls tell me whats going on in the code snippet below:
>
n = 10
statstr = "N = ",n
type(statstr) #case1
>
print statstr
> ('N = ', 10)
print "N = ",n
Hi,
Pls tell me whats going on in the code snippet below:
>>> n = 10
>>> statstr = "N = ",n
>>> type(statstr) #case1
>>> print statstr
('N = ', 10)
>>> print "N = ",n #case 2
N = 10
In the first case the result is printed as a tuple
On Oct 31, 3:53 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> LaundroMat wrote:
> > That 'magic index' variable bugs me a little however. It gives me the
> > same feeling as when I see hard-coded variables.what magic index? the
> > variable named "index" is an argument to the
> method it's used
LaundroMat wrote:
> That 'magic index' variable bugs me a little however. It gives me the
> same feeling as when I see hard-coded variables.
what magic index? the variable named "index" is an argument to the
method it's used in.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks all, those were some great explanations. It seems I have still
still a long way for me to go before I grasp the intricacies of this
language.
That 'magic index' variable bugs me a little however. It gives me the
same feeling as when I see hard-coded variables. I suppose the
generator class
Ack, I get it now. It's not the variable's name ("index") that is
hard-coded, it's just that the for...in... loop sends an argument by
default. That's a lot more comforting.
--
http://mail.python.org/mailman/listinfo/python-list
LaundroMat wrote:
[me hitting send too soon]
> Now, if I look at this script step by step, I don't understand:
> - where the "while 1:"-loop is quitted.
> class DirectoryWalker:
> # a forward iterator that traverses a directory tree
>
> def __init__(self, directory):
> self.sta
On Tue, 31 Oct 2006 03:36:08 -0800, LaundroMat wrote:
> Hi,
>
> I've found this script over at effbot
> (http://effbot.org/librarybook/os-path.htm), and I can't get my head
> around its inner workings.
[snip code]
> Now, if I look at this script step by step, I don't understand:
> - what is be
LaundroMat wrote:
> Hi,
>
> I've found this script over at effbot
> (http://effbot.org/librarybook/os-path.htm), and I can't get my head
> around its inner workings. Here's the script:
>
> import os
>
> class DirectoryWalker:
> # a forward iterator that traverses a directory tree
>
> d
LaundroMat wrote:
> Now, if I look at this script step by step, I don't understand:
> - what is being iterated over (what is being called by "file in
> DirectoryWalker()"?);
as explained in the text above the script, this class emulates a
sequence. it does this by implementing the __getindex__
Hi,
I've found this script over at effbot
(http://effbot.org/librarybook/os-path.htm), and I can't get my head
around its inner workings. Here's the script:
import os
class DirectoryWalker:
# a forward iterator that traverses a directory tree
def __init__(self, directory):
self.
The : is used in Python for slice notation, which is explained pretty
thoroughly in the Python tutorial, specifically at:
http://www.python.org/doc/2.4/tut/node5.html
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I am a programmer, but not a python guy. So I am a little confused with
the following python code. Specifically what does the ":" do in the
array arithmetic?
new_page = map[opage]
old_page = map[opage^1]
center = new_page[1:-1,1:-1]
origcenter = array(center)
center[:]
32 matches
Mail list logo