Re: [Tutor] defining functions and classes

2011-01-15 Thread Brett Murch
Yes you are right it is a Name error because skills was not defined. Sorry will make things more clear in the future. I have it sorted now. Will just start from the beginning and try not to go to fast. On Sat, 2011-01-15 at 21:34 +1100, Steven D'Aprano wrote: > Brett Murch wrote: > > > I keep ge

Re: [Tutor] defining functions and classes

2011-01-15 Thread Brett Murch
On Sat, 2011-01-15 at 08:23 -0500, Dave Angel wrote: > On 01/-10/-28163 02:59 PM, Brett Murch wrote: > > Hi everyone, > > > > I'm just starting to learn Python and am starting by creating a text > > game but am having trouble with classes and funtions. I want to create a > > class or function where

Re: [Tutor] defining functions and classes

2011-01-15 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Brett Murch wrote: Hi everyone, I'm just starting to learn Python and am starting by creating a text game but am having trouble with classes and funtions. I want to create a class or function where someone creates a charater and has a choice of their name or os. This i

Re: [Tutor] defining functions and classes

2011-01-15 Thread Alan Gauld
"Brett Murch" wrote game but am having trouble with classes and funtions. I want to create a class or function where someone creates a charater and has a choice of their name or os. This is what I have so far; class Administrator(): def Skills(name,os): OK, You have a ways to go to und

Re: [Tutor] defining functions and classes

2011-01-15 Thread Steven D'Aprano
Brett Murch wrote: I keep getting a syntax error on calling it. any ideas on what I'm doing wrong? Should we *guess*, or would you like to share with us the actual error you are getting? My guess is that you're not getting a syntax error at all, you're getting a NameError that Skills is no

Re: [Tutor] defining functions and classes

2011-01-15 Thread Kann Vearasilp
Do you also have to define the class attributes? class Administrator(): name = "" os = "" def Skills(name,os): name = raw_input('What is your name') os = raw_input('What is your os') self.name = name self.os = os Skills(name,os) On Sat, Jan 15, 2011 at 11:10

[Tutor] defining functions and classes

2011-01-15 Thread Brett Murch
Hi everyone, I'm just starting to learn Python and am starting by creating a text game but am having trouble with classes and funtions. I want to create a class or function where someone creates a charater and has a choice of their name or os. This is what I have so far; class Administrator():