Re: [Tutor] How do I create the equivalent of a Java class in Python?

2006-05-16 Thread Alan Gauld
> Erm. Shouldn't that be the following? > > class Msg: > def __init__(self,s): > self.s = s > def say(self): > if *not *self.s: print "No message" > else: print self.s Yep, its my week for making mistakes. Although this one was just a typo... My only excuse is that I'm really

Re: [Tutor] How do I create the equivalent of a Java class in Python?

2006-05-16 Thread Orri Ganel
Alan Gauld wrote: > > How do I create the equivalent of a Java class in Python? I've been > looking > > at the reference, and it's been confusing to me at least. > > Adapted from my book: > > Java code: > > class Msg{ >private String txt; >public Msg(String s){ > this.txt = s;

Re: [Tutor] How do I create the equivalent of a Java class in Python?

2006-05-14 Thread Alan Gauld
> How do I create the equivalent of a Java class in Python? I've been looking> at the reference, and it's been confusing to me at least.   Adapted from my book:   Java code:   class Msg{    private String txt;    public Msg(String s){   this.txt = s;    }    public void say(){   if

Re: [Tutor] How do I create the equivalent of a Java class in Python?

2006-05-13 Thread Danny Yoo
> How do I create the equivalent of a Java class in Python? I've been > looking at the reference, and it's been confusing to me at least. You may want to look at a tutorial on classes, like: http://www.freenetpages.co.uk/hp/alan.gauld/tutclass.htm Does this help? Best of wishes!

Re: [Tutor] How do I create the equivalent of a Java class in Python?

2006-05-13 Thread w chun
> How do I create the equivalent of a Java class in Python? I've been looking > at the reference, and it's been confusing to me at least. can you clarify what you are looking for? do you want to create a class using Python, create the equivalent of a Java class using Python via Jython, accessing

[Tutor] How do I create the equivalent of a Java class in Python?

2006-05-13 Thread Nathan Pinno
Hey all,   How do I create the equivalent of a Java class in Python? I've been looking at the reference, and it's been confusing to me at least.   Thanks, Nathan Pinno   ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo