On Fri, May 23, 2008 at 7:52 PM, inhahe <[EMAIL PROTECTED]> wrote:
> why doesn't this work?
>
class a:
> ... @staticmethod
> ... def __getattr__(attr):
> ... return "I am a dork"
> ...
f = a()
f.hi
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: 'sta
On Fri, May 23, 2008 at 5:22 PM, Yuanxin Xi <[EMAIL PROTECTED]> wrote:
> I'm a Python newbie and still exploring, just surprised to see this 2D list
> assignment while debugging.
http://www.python.org/doc/faq/programming/#how-do-i-create-a-multidimensional-list
Kent
__
why doesn't this work?
>>> class a:
... @staticmethod
... def __getattr__(attr):
... return "I am a dork"
...
>>> f = a()
>>> f.hi
Traceback (most recent call last):
File "", line 1, in
TypeError: 'staticmethod' object is not callable
___
Tuto
"Yuanxin Xi" <[EMAIL PROTECTED]> wrote
I'm a Python newbie and still exploring, just surprised to see this
2D list assignment while debugging.
>>> a = [[0] *3] *4
This creates a list with 3 zeros then creates a second list
with 4 references to the first list.
Remember that in Python all var
Oops! Forgot to "Reply to All"
I'm not sure but take a look at this:
>>> a = [[0]*3]*4
>>> a
[[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]
>>> a[1]
[0, 0, 0]
>>> a[0][0] = 4
>>> a
[[4, 0, 0], [4, 0, 0], [4, 0, 0], [4, 0, 0]]
>>> b = [[0,0,0],[0,0,0],[0,0,0]]
>>> b
[[0, 0, 0], [0,
I'm a Python newbie and still exploring, just surprised to see this 2D
list assignment while debugging.
>>> a = [[0] *3] *4
>>> a
[[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]
>>> a[1][2] = 1
>>> a
[[0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1]]
why is that a[0][2] a[1][2] a[2][2] a[3][2] are all a
On Fri, May 23, 2008 at 2:25 PM, Moishy Gluck <[EMAIL PROTECTED]> wrote:
> I came in python around 2.5. So I've been using "Boolean and 1 or 2".
For Python 2.5 you should use the new syntax
1 if Boolean or 2
It doesn't have the problems of the unofficial syntax you quote.
Kent
On Fri, May 23, 2008 10:06 am, Alan Gauld wrote:
> "Marilyn Davis" <[EMAIL PROTECTED]> wrote
>
>
>> (I'm sorry for the duplicate, Alan.)
>>
>
> I didn't see a duplicate! ;-)
>
>
>>> linecount = 0 for line in file("itemconfig.txt", 'rU'): if line ==
>>> objectToLoad or linecount > 0: if linecount =
"Marilyn Davis" <[EMAIL PROTECTED]> wrote
(I'm sorry for the duplicate, Alan.)
I didn't see a duplicate! ;-)
linecount = 0
for line in file("itemconfig.txt", 'rU'):
if line == objectToLoad or linecount > 0:
if linecount == 0: linecount = 5
itemList.append(line.split()[:5
"dnr" <[EMAIL PROTECTED]> wrote
are there any volunteer who'd like to do some good for the python
community?
To be short - Decompyle package currently only supports python
versions prior to 2.4.
These sort of requests are probably better targetted at
the main comp.lang.python list rather than
(I'm sorry for the duplicate, Alan.)
On Fri, May 23, 2008 3:49 am, Alan Gauld wrote:
> "Jason Conner" <[EMAIL PROTECTED]> wrote
>
>
>> building a program that will take a text file, search for a string in
>> that text file. Once it finds the string its looking for, I want to put
>> the next five
Hello,
are there any volunteer who'd like to do some good for the python community?
To be short - Decompyle package currently only supports python versions prior
to 2.4.
After small tuning it seems to support 2.4 and 2.5partly
Some tuning is required in parser.py which maps disassembled op
Hi,
I messed in earlier message, my apologies.
Message: 1
Date: Fri, 23 May 2008 00:25:23 +0100
From: "Alan Gauld" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Equivalent 'case' statement
To: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1
"Jason Conner" <[EMAIL PROTECTED]> wrote
building a program that will take a text file, search for a string
in that
text file. Once it finds the string its looking for, I want to put
the next
five lines of text into a variable. Here's what I have so far:
def loadItem(self, objectToLoad):
On Wed, May 21, 2008 at 10:51 AM, jatinder Singh
<[EMAIL PROTECTED]> wrote:
> Hi .
>
>I am trying to change two lines in a single file (etc/php.ini) but my
> script is not doing this in one time .
See my answer to your almost identical question last week about
modifying httpd.conf.
Kent
[EMAIL PROTECTED] wrote:
Send Tutor mailing list submissions to
tutor@python.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can
16 matches
Mail list logo