Re: [Tutor] Writing Classes in python

2006-11-01 Thread Rajesh R
Thanks All, It worked. Rajesh >From: Andreas Kostyrka <[EMAIL PROTECTED]> >To: Rajesh R <[EMAIL PROTECTED]> >CC: Tutor@python.org >Subject: Re: [Tutor] Writing Classes in python >Date: Wed, 01 Nov 2006 22:39:57 +0100 > >class Sample: > def method1(s

Re: [Tutor] Writing Classes in python

2006-11-01 Thread Andreas Kostyrka
class Sample: def method1(self): print "method1" s = Sample() s.method1() Please notice, you need () to invoke a method in Python, and you need an explicit self argument on the method definition. Andreas Am Mittwoch, den 01.11.2006, 21:21 + schrieb Rajesh R: > I am new to Python

Re: [Tutor] Writing Classes in python

2006-11-01 Thread Danny Yoo
On Wed, 1 Nov 2006, Rajesh R wrote: > I am new to Python and i have a very basic question about writing > classes. Lets say i have the following code : > [code cut] Hi Rajesh, Take a look at a Python class tutorial: http://www.diveintopython.org/object_oriented_framework/defining_classes.htm

Re: [Tutor] Writing Classes in python

2006-11-01 Thread Kent Johnson
Rajesh R wrote: > I am new to Python and i have a very basic question about writing classes. > Lets say i have the following code : > > class Sample: > 'A simple class' > > def method1(): >print 'Inside Method1' > > When i create an instance of the class and when i try to call the metho

[Tutor] Writing Classes in python

2006-11-01 Thread Rajesh R
I am new to Python and i have a very basic question about writing classes. Lets say i have the following code : class Sample: 'A simple class' def method1(): print 'Inside Method1' When i create an instance of the class and when i try to call the method method1, i get an error message.