Alan Gauld wrote:
Which tutor are you using? If its the standard Python tutor then its
not really for beginners to OOP,
Yes, I was talking about the one that comes with Python. Now I
understand why I couldn't figure much of it!
you might be better looking at some
of the more basic tutors such as
> I'm already confused! Seriously, I never done oop before, so even
the
> Python tutorial examples are extremely confusing to me atm.
Which tutor are you using? If its the standard Python tutor then its
not really for beginners to OOP, you might be better looking at some
of the more basic tutors s
Alan Gauld wrote:
You have 3 methods, functions and methods are similar but different!
If you think of them asthe same thing you will probably get
confused by OOP later on!
[Bernard]
I'm already confused! Seriously, I never done oop before, so even the
Python tutorial examples are extremely confus
> Okay here comes the next question.
>
> In that class, I have 3 functions. Actually, one of them calls the
two
> others.
You have 3 methods, functions and methods are similar but different!
If you think of them asthe same thing you will probably get
confused by OOP later on!
> However when I cal
Bernard Lebel wrote:
Okay here comes the next question.
In that class, I have 3 functions. Actually, one of them calls the two
others.
However when I call these functions (wich are placed before the caller
in the file), I get an error saying that the global name x (the function
name) is not def
Okay here comes the next question.
In that class, I have 3 functions. Actually, one of them calls the two
others.
However when I call these functions (wich are placed before the caller
in the file), I get an error saying that the global name x (the function
name) is not defined.
What am I doin
All righty, thanks a lot!
Bernard
tanja pislar wrote:
hi Bernard,
you have to specify the module as well:
let's say your module is called rtModule.py,
then in your case you'd do:
import rtModule
testClass = rtModule.rt()
testClass.walk()
or:
from rtModule import rt
testClass = rt()
testClass.walk()
hi Bernard,
you have to specify the module as well:
let's say your module is called rtModule.py,
then in your case you'd do:
import rtModule
testClass = rtModule.rt()
testClass.walk()
or:
from rtModule import rt
testClass = rt()
testClass.walk()
regards,
tanja
On Sun, 02 Jan 2005 17:43:07
Hello,
An easy one to start the year.
Trying to write my first class, already running into problems after 3
lines! :-(
So have this little class:
class rt:
def walk(self):
print 'yeah'
So if I write this in the Python shell, instantiate rt and call walk(),
I get the prope