On 07/27/2016 04:04 AM, Alan Gauld via Tutor wrote:
On 27/07/16 04:44, Jim Byrnes wrote:
OOP has always driven me crazy. I read the material and follow the
examples until I feel I understand them, but when I try to implement it
I end up with an error filled mess.
That suggests that its not th
On 07/27/2016 03:12 AM, Peter Otten wrote:
Jim Byrnes wrote:
OOP has always driven me crazy. I read the material and follow the
examples until I feel I understand them, but when I try to implement it
I end up with an error filled mess.
So I decided to give it another try. When I got to the c
On 07/26/2016 11:38 PM, Ben Finney wrote:
Jim Byrnes writes:
So I decided to give it another try. When I got to the chapter on
tkinter I decided to solve all the exercises using OOP even though the
book solutions did not use OOP.
Hmm, that sounds ill advised.
OOP is one tool among many; try
On 27/07/16 04:44, Jim Byrnes wrote:
> OOP has always driven me crazy. I read the material and follow the
> examples until I feel I understand them, but when I try to implement it
> I end up with an error filled mess.
That suggests that its not the OOP concept thats confusing
you but the langua
Jim Byrnes wrote:
> OOP has always driven me crazy. I read the material and follow the
> examples until I feel I understand them, but when I try to implement it
> I end up with an error filled mess.
>
> So I decided to give it another try. When I got to the chapter on
> tkinter I decided to sol
Jim Byrnes writes:
> So I decided to give it another try. When I got to the chapter on
> tkinter I decided to solve all the exercises using OOP even though the
> book solutions did not use OOP.
Hmm, that sounds ill advised.
OOP is one tool among many; trying to apply it where it's a poor fit
wi
OOP has always driven me crazy. I read the material and follow the
examples until I feel I understand them, but when I try to implement it
I end up with an error filled mess.
So I decided to give it another try. When I got to the chapter on
tkinter I decided to solve all the exercises using
If you want to test if one outcome is equal to another, you probably want to
know if
The name of the outcome is the same
The odds of the outcome is the same
So, you'd implement it like so
class Outcome:
def __eq__(self, other):
if self.name == other.name and self.odds == other.odds:
Ben Ganzfried wrote:
Hey guys,
I'm trying to get a version of Roulette working and I had a quick question.
There's a quick answer and long answer. The quick answer is, you have to
refer to self.odds, not just odds. The long answer is below:
Here is my code:
[...]
Now whenever I try to ca
Updated inline. Check the updated definiton of winAmount.
Nick
On Tue, Jan 18, 2011 at 9:25 AM, Ben Ganzfried wrote:
> Hey guys,
>
> I'm trying to get a version of Roulette working and I had a quick
> question. Here is my code:
>
> class Outcome:
>
> def __init__(self, name, odds):
>
Hey guys,
I'm trying to get a version of Roulette working and I had a quick question.
Here is my code:
class Outcome:
def __init__(self, name, odds):
self.name = name
self.odds = odds
def winAmount(self, amount):
return odds*amount
def __eq__(self, other):
On 06/03/10 01:37, Jim Byrnes wrote:
>
>>> some older procedural languages I always end up becoming confused by
>>> the large number of built in methods.
>>
>> C is one of the simplest procedural languages around
>> and yet it comes with a huge library of functions (several
>> hundred in some case
Steven D'Aprano wrote:
Case in point is this code snippet from a chapter on Tkinter.
def viewer(imgdir, kind=Toplevel, cols=None):
"""
make thumb links window for an image directory:
one thumb button per image; use kind=Tk to show
in main app window, or Frame container
Alan Gauld wrote:
"Jim Byrnes" wrote
Whenever I teach myself a new language I have great difficulty
understanding the nuts and bolts of it's OO implementation.
Do you understand the OO concepts OK?
Is it only the language semantics you struggle with
or the underlying OO concepts?
I believe
Steve Willoughby wrote:
On Tue, Jun 01, 2010 at 03:19:17PM -0500, Jim Byrnes wrote:
def viewer(imgdir, kind=Toplevel, cols=None):
win = kind()
What is the relationship between kind=Toplevel in the first line and
win=kind() further down. Isn't "kind" a variable and "kind()" a method?
kin
On Wed, 2 Jun 2010 06:19:17 am Jim Byrnes wrote:
> Whenever I teach myself a new language I have great difficulty
> understanding the nuts and bolts of it's OO implementation. Compared
> to some older procedural languages I always end up becoming confused
> by the large number of built in methods.
"Jim Byrnes" wrote
Whenever I teach myself a new language I have great difficulty
understanding the nuts and bolts of it's OO implementation.
Do you understand the OO concepts OK?
Is it only the language semantics you struggle with
or the underlying OO concepts?
some older procedural languag
On Tue, Jun 01, 2010 at 03:19:17PM -0500, Jim Byrnes wrote:
> def viewer(imgdir, kind=Toplevel, cols=None):
> win = kind()
>
> What is the relationship between kind=Toplevel in the first line and
> win=kind() further down. Isn't "kind" a variable and "kind()" a method?
kind is a variable.
Whenever I teach myself a new language I have great difficulty
understanding the nuts and bolts of it's OO implementation. Compared to
some older procedural languages I always end up becoming confused by the
large number of built in methods. When reading through code examples I
many times get
On Wed, Apr 15, 2009 at 3:43 AM, mbikinyi brat wrote:
> Dear ALL,
> I am a python beginner and has never programmed and has been struggling to
> understand how to create objects or classes in python. Can anyone help with
> any concrete example. I have read most recommended textbooks but still have
"mbikinyi brat" wrote
I am a python beginner and has never programmed
Welcome to the tutor list.
and has been struggling to understand how to create
objects or classes in python. Can anyone help with any
concrete example.
Most tutorials have examples of classes and objects.
Certainly
Dear ALL,
I am a python beginner and has never programmed and has been struggling to
understand how to create objects or classes in python. Can anyone help with any
concrete example. I have read most recommended textbooks but still have
difficulties figuring what it is all about.
Thanks,
Henry
"Stefan Lesicnik" wrote
I am a relative newbie to python and OOP concepts and am trying to
work through wxpython. I've seen understanding classes is essential to
this and have been trying to work through them.
Steve gave you the basic explanation, I'll try a slightly different tack
- which ma
"Skipper Seabold" wrote
tutorial or documentation re OOP and classes?
I've found Alan Gauld's tutorials to be very useful when just getting
started in both OOP and Python.
http://www.freenetpages.co.uk/hp/alan.gauld/
Thanks for the plug :-)
However the URL has changed since freenetpages
On Fri, Apr 10, 2009 at 08:44:37PM +0200, Stefan Lesicnik wrote:
> I am a relative newbie to python and OOP concepts and am trying to
> work through wxpython. I've seen understanding classes is essential to
> this and have been trying to work through them.
Welcome! If you're really new, wxpython
On Fri, Apr 10, 2009 at 2:44 PM, Stefan Lesicnik wrote:
> I guess as a general kind of question, can anyone recommend some
> tutorial or documentation re OOP and classes?
I've found Alan Gauld's tutorials to be very useful when just getting
started in both OOP and Python.
http://www.freenetpages
Hi guys,
I am a relative newbie to python and OOP concepts and am trying to
work through wxpython. I've seen understanding classes is essential to
this and have been trying to work through them.
I have a few questions re the below code (i suspect its due to a lack
of my understanding of classes)
Original Brownster wrote:
> --- Kent Johnson <[EMAIL PROTECTED]> wrote:
>> This all sounds good. You have a module, Streamrip, that implements
>> the
>> core functionality you need. From your description, this module
>> doesn't
>> know about the GUI so it could be reused by another kind of client
--- Kent Johnson <[EMAIL PROTECTED]> wrote:
> Original Brownster wrote:
> > Hi,
> > I'm fairly new to using OOP and very new to Python, my first
> program is
> > coming along well and I have split the code into 2 modules.
> >
> > The program finds stream urls, downloads them, re-encodes them to
"Original Brownster" <[EMAIL PROTECTED]> wrote
> The program finds stream urls, downloads them, re-encodes them to
> othe
> formats, all this functionality I have created in one module with
> one
> class called Streamrip and methods to handle this.
Good so far.
One nitpick is that class names
Original Brownster wrote:
> Hi,
> I'm fairly new to using OOP and very new to Python, my first program is
> coming along well and I have split the code into 2 modules.
>
> The program finds stream urls, downloads them, re-encodes them to othe
> formats, all this functionality I have created in one
Hi,
I'm fairly new to using OOP and very new to Python, my first program is
coming along well and I have split the code into 2 modules.
The program finds stream urls, downloads them, re-encodes them to othe
formats, all this functionality I have created in one module with one
class called Streamri
on a related topic, if you're concerned about security, esp. of your
instance attributes, new-style classes offer you significantly more
control over them using descriptors (including properties [and to a
lesser extent, slots]). there is plenty of docs available on those, so
i'll defer describing t
Chris, you are right.
He (Alan) hits the bull's eye, always !!
Cheers...
Asrarahmed
On 10/25/06, Chris Hengge <[EMAIL PROTECTED]> wrote:
I dont know about the rest of you, but this thread posting from Alan cleared up some fuzzyness I've had about classes. /me is happier using this. instead of
Thanks a lot for explanation.
Regards,
Asrarahmed
On 10/25/06, Alan Gauld <[EMAIL PROTECTED]> wrote:
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote
> Why is it necessary to explicity use self argument in the class> functionsBecause Guido made it that way. :-)But he did it for good reasons which
I dont know about the rest of you, but this thread posting from Alan cleared up some fuzzyness I've had about classes. /me is happier using this. instead of self. =DGreat post!
On 10/25/06, Alan Gauld <[EMAIL PROTECTED]> wrote:
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote> Why is it necessary to ex
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote
> Why is it necessary to explicity use self argument in the class
> functions
Because Guido made it that way. :-)
But he did it for good reasons which others have pointed out already.
Although languages like C++ and Java use implicit object reference
Asrarahmed Kadri googlemail.com> writes:
> the use of 'self' keyword really confuses me.
I see how it can annoy you, but not how it can *confuse* you - if anything,
"self" removes any confusion about whether you're looking at a local variable or
an object property. By the way, the use of specia
Asrarahmed Kadri escribió:
>
>
> Folks...
>
> Please dont take it in a wrong sense. But I have a point to make
> regarding OOP and the way it is implemented in Python.
>
> Why is it necessary to explicity use self argument in the class
> functions ?? I feel the language/interpreter shoul
On 10/25/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:
> Why is it necessary to explicity use self argument in the class functions
> ?? I feel the language/interpreter should figure out which object has called
> the function? Isnt it ? (the use of 'self' keyword really confuses me. and
> to make
Folks...
Please dont take it in a wrong sense. But I have a point to make regarding OOP and the way it is implemented in Python.
Why is it necessary to explicity use self argument in the class functions ?? I feel the language/interpreter should figure out which object has called the functi
s sincerely,__János Juhász> Message: 5> Date: Mon, 19 Sep 2005 17:01:30 -0400
> From: Ed Hotchkiss <[EMAIL PROTECTED]>> Subject: Re: [Tutor] OOP fundamentals> To: Danny Yoo <[EMAIL PROTECTED]
>> Cc: Tutor <tutor@python.org>> Message-ID: <[EMAIL PROTEC
From: Ed Hotchkiss <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] OOP fundamentals
> To: Danny Yoo <[EMAIL PROTECTED]>
> Cc: Tutor
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="iso-8859-1"
> Thanks Danny! Tommorrow I am off t
Excellent, I'll be getting that book tomorrow! Thanks again, I'm doing a tutorial as we speak!
On 9/19/05, Danny Yoo <[EMAIL PROTECTED]> wrote:
On Mon, 19 Sep 2005, Ed Hotchkiss wrote:> Thanks Danny! Tommorrow I am off to get "Programming for Python, 2nd
> edition" and learn everything - all of i
On Mon, 19 Sep 2005, Ed Hotchkiss wrote:
> Thanks Danny! Tommorrow I am off to get "Programming for Python, 2nd
> edition" and learn everything - all of it, before I even bother with
> Sockets.
Hi Ed,
I'd disrecommend Programming Python if you're a beginner. Programming
Python is really more
Thanks Danny! Tommorrow I am off to get "Programming for Python, 2nd edition" and learn everything - all of it, before I even bother with Sockets. Afterall, I want python for EVERYTHING not just sockets and inet based scripts/applications.
I realized that I need to take a step back, make port s
On Mon, 19 Sep 2005, Ed Hotchkiss wrote:
> Thanks for the link! It is EXACTLY what I have been looking for. When I
> used to use Flash a bit, and did some actionscript they had a similiar
> setup for OOP (Do all languages use OOP so similiarly?) which I never
> learned.
Hi Ed,
I believe that
47 matches
Mail list logo