Why can't I run this test class?

2009-09-11 Thread Kermit Mei
Dear all, I'm a newbie for python, and I write a program to test how to implement a class: #!/usr/bin/env python class Test: 'My Test class' def __init__(self): self.arg1 = 1 def first(self): return

Re: Why can't I run this test class?

2009-09-11 Thread Kermit Mei
On Fri, 2009-09-11 at 00:33 -0700, Chris Rebert wrote: On Fri, Sep 11, 2009 at 12:30 AM, Kermit Mei kermit@gmail.com wrote: Dear all, I'm a newbie for python, and I write a program to test how to implement a class: #!/usr/bin/env python class Test: 'My Test class

Re: Why can't I run this test class?

2009-09-11 Thread Kermit Mei
On Fri, 2009-09-11 at 00:43 -0700, Chris Rebert wrote: On Fri, Sep 11, 2009 at 12:40 AM, Kermit Mei kermit@gmail.com wrote: On Fri, 2009-09-11 at 00:33 -0700, Chris Rebert wrote: On Fri, Sep 11, 2009 at 12:30 AM, Kermit Mei kermit@gmail.com wrote: Dear all, I'm a newbie

How can I use my modules here?

2009-09-11 Thread Kermit Mei
the main.py, the following error takes: $ ./main.py from: can't read /var/mail/MyTestModules ./main.py: line 7: syntax error near unexpected token `(' ./main.py: line 7: `t1 = Test1()' Waiting for your help. Thanks. Best Regards Kermit Mei -- http://mail.python.org/mailman/listinfo/python

Re: How can I use my modules here?

2009-09-11 Thread Kermit Mei
On Fri, 2009-09-11 at 07:48 -0400, Albert Hopkins wrote: On Fri, 2009-09-11 at 02:29 -0700, Chris Rebert wrote: For some reason, your Python program is being executed by bash as if it were a shell script, which it's not. No idea what the cause is though. Because the first 2 bytes of the

How can I understan the for here?

2008-12-11 Thread Kermit Mei
Hello all, look at the following sentence: params = {server:mpilgrim, database:master, uid:sa, pwd:secret} [%s=%s % (k, v) for k, v in params.items()] ['pwd=secret', 'database=master', 'uid=sa', 'server=mpilgrim'] I can't understand the second sentence because of the for ... in. I consider

Re: How can I understan the for here?

2008-12-11 Thread Kermit Mei
D'Arcy J.M. Cain wrote: On Thu, 11 Dec 2008 22:44:20 +0800 Kermit Mei [EMAIL PROTECTED] wrote: [%s=%s % (k, v) for k, v in params.items()] ['pwd=secret', 'database=master', 'uid=sa', 'server=mpilgrim'] I can't understand the second sentence because of the for ... in. I consider

Re: A question about reference in Python.

2008-12-07 Thread Kermit Mei
Chris Rebert wrote: On Sun, Dec 7, 2008 at 9:26 PM, Group [EMAIL PROTECTED] wrote: Hello, I'm studying algorithom. For concentrating on the question itself, I intend to use Python to implement the algorithoms. Now, I want to write a Red-Black Tree, and a List structure. In C/C++, I can use