About Python Symbian 60

2009-08-19 Thread Kannan
Hi friends
I want a Python SDK like Netbeans to work with the Symbian 60 python.
I don't have the Symbian 60 mobile.I create some Apps for S60 Platform.To
execute that i want this
Help me..






With regards,

Kannan. R. P,
-- 
http://mail.python.org/mailman/listinfo/python-list


TypeError: unbound method DefaultTracer() must be called with MyClass instance as first argument (got str instance instead)

2011-07-07 Thread Kannan Varadhan
Hi Folks,

Here is something I don't fully understand.

  1 def DefaultTracer(fmt, *args):
  2   fmt = 'in DefaultTracer ' + fmt
  3   print(fmt % args)
  4   pass
  5 def myTracer(fmt, *args):
  6   fmt = 'in myTracer ' + fmt
  7   print(fmt % args)
  8
  9 class MyClass:
 10   ClassDefaultTracer = DefaultTracer
 11   def __init__(self):
 12 self.InstanceTracer = MyClass.ClassDefaultTracer
 13   def trace(self, fmt, *args):
 14 self.InstanceTracer(fmt, *args)
 15
 16
 17 DefaultTracer("Testing %s", 'at first')
 18 myTracer("Testing %s", 'at first')
 19
 20 MyClass().trace('Using ClassDefaultTracer')
 21
 22 # override ClassDefaultTracer for all new instances
 23 MyClass.ClassDefaultTracer = myTracer
 24 MyClass().trace('Using Overridden ClassDefaultTracer')

I want ClassDefaultTracer to store a reference to DefaultTracer and be
used by instances of MyClass.  Why does line20 give me the following
error:

$ python foo.py
in DefaultTracer Testing at first
in myTracer Testing at first
Traceback (most recent call last):
  File "foo.py", line 20, in 
MyClass().trace('Using ClassDefaultTracer')
  File "foo.py", line 14, in trace
self.InstanceTracer(fmt, *args)
TypeError: unbound method DefaultTracer() must be called with MyClass
instance as first argument (got str instance instead)

Alternately, how can I achieve what I want, i.e. a class-wide default
used by all instances created off it, but
itself be changeable, so that once changed, the changed default would
be used by subsequent newer instances of that class.

Thanks,

Kannan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError: unbound method DefaultTracer() must be called with MyClass instance as first argument (got str instance instead)

2011-07-10 Thread Kannan Varadhan
Thanks folks,

Tried all of these, and went with staticmethod().  Was cleanest
solution,

> After skimming over Steven's post: use staticmethod.
> No idea why I didn't think of that myself.


Kannan
-- 
http://mail.python.org/mailman/listinfo/python-list