Re: Not Defined error in basic code

2019-03-14 Thread DL Neil
Thank you sir. I think you may be on to something there. I've done mainframe, machine, 3GL, and 4GL languages, but the last couple I've taken on have given me headaches. I guess I'll have to just read a bunch first and then try and write something simpler than what I'm attempting to take on...

Re: Not Defined error in basic code

2019-03-14 Thread Jack Dangler
On 3/14/19 3:49 PM, DL Neil wrote: Just getting started with tutorials and such, and don't understand this - Did you answer the post asking which tutorial you were following/copying? Sorry - it is this - https://www.learnpython.org/en/ .. The section is on classes and objects - https://www.l

Re: Not Defined error in basic code

2019-03-14 Thread DL Neil
Just getting started with tutorials and such, and don't understand this - Did you answer the post asking which tutorial you were following/copying? Sorry - it is this - https://www.learnpython.org/en/ .. The section is on classes and objects - https://www.learnpython.org/en/Classes_and_Objects

Re: Not Defined error in basic code

2019-03-14 Thread Jack Dangler
On 3/14/19 2:28 PM, DL Neil wrote: Jack, On 15/03/19 3:05 AM, Jack Dangler wrote: Just getting started with tutorials and such, and don't understand this - Did you answer the post asking which tutorial you were following/copying? Sorry - it is this - https://www.learnpython.org/en/ ..

Re: Not Defined error in basic code

2019-03-14 Thread DL Neil
Jack, On 15/03/19 3:05 AM, Jack Dangler wrote: Just getting started with tutorials and such, and don't understand this - Did you answer the post asking which tutorial you were following/copying? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Not Defined error in basic code

2019-03-14 Thread Jack Dangler
On 3/14/19 12:50 PM, Calvin Spealman wrote: You still need to get of the two lines at the start of your class, they are unnecessary and reference variables you never defined: class weapon:     weaponId  # Get rid of this line!     manufacturerName  # And this one, too! On Thu, Mar 14, 2019 at

Re: Not Defined error in basic code

2019-03-14 Thread Calvin Spealman
You still need to get of the two lines at the start of your class, they are unnecessary and reference variables you never defined: class weapon: weaponId # Get rid of this line! manufacturerName # And this one, too! On Thu, Mar 14, 2019 at 12:43 PM Jack Dangler wrote: > > On 3/14/19 1

Re: Not Defined error in basic code

2019-03-14 Thread Jack Dangler
On 3/14/19 10:39 AM, Calvin Spealman wrote: A few notes, Jack: On Thu, Mar 14, 2019 at 10:32 AM Jack Dangler > wrote: On 3/14/19 10:11 AM, Calvin Spealman wrote: Where are you seeing something like this? The two lines under `class weapon:` are not correc

Re: Not Defined error in basic code

2019-03-14 Thread Calvin Spealman
A few notes, Jack: On Thu, Mar 14, 2019 at 10:32 AM Jack Dangler wrote: > > On 3/14/19 10:11 AM, Calvin Spealman wrote: > > Where are you seeing something like this? The two lines under `class > weapon:` are not correct because they are variable names that you've never > defined. > > Maybe you i

Re: Not Defined error in basic code

2019-03-14 Thread Jack Dangler
On 3/14/19 10:11 AM, Calvin Spealman wrote: Where are you seeing something like this? The two lines under `class weapon:` are not correct because they are variable names that you've never defined. Maybe you intended this to "declare" the attributes for the class? That isn't something you nee

Re: Not Defined error in basic code

2019-03-14 Thread Jason Friedman
On Thu, Mar 14, 2019 at 8:07 AM Jack Dangler wrote: > > > class weapon: > weaponId > manufacturerName > > def printWeaponInfo(self): > infoString = "ID: %d Mfg: %s Model: %s" % (self.weaponId, > self.manufacturerName) > return infoString > > > > import class_wea

Re: Not Defined error in basic code

2019-03-14 Thread Dan Sommers
On 3/14/19 9:05 AM, Jack Dangler wrote: Just getting started with tutorials and such, and don't understand this - class weapon:     weaponId     manufacturerName The previous two lines attempt to refer to existing names, but neither name exists.     def printWeaponInfo(self):  

Re: Not Defined error in basic code

2019-03-14 Thread Calvin Spealman
Where are you seeing something like this? The two lines under `class weapon:` are not correct because they are variable names that you've never defined. Maybe you intended this to "declare" the attributes for the class? That isn't something you need to do in Python. If you simply remove these line

Re: Not defined

2005-10-03 Thread Richie Hindle
[Rob] > >>> from cgkit import * > >>> Sphere() > Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'Sphere' is not defined Do you have a file of your own called cgkit.py? You're probably importing that rather than the real thing. Try this: >>> import cgkit >>> prin

Re: Not defined

2005-10-01 Thread Rob
Thanks for the replies gives me something to chew on. Regards Gramps -- http://mail.python.org/mailman/listinfo/python-list

Re: Not defined

2005-10-01 Thread Pekka Karjalainen
I looked around a bit and found the answer. At least the change I recommend below worked for me. In article <[EMAIL PROTECTED]>, Rob wrote: >When trying the basic tutorial for cgkit I always seem to get a not defined >error as follows. > >Pythonwin GUI > from cgkit import * This is "from cg

Re: Not defined

2005-10-01 Thread Kent Johnson
Rob wrote: > When trying the basic tutorial for cgkit I always seem to get a not defined > error as follows. > > Pythonwin GUI > > from cgkit import * Sphere() > > Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'Sphere' is not defined Which version of c

Re: Not defined

2005-10-01 Thread Pekka Karjalainen
In article <[EMAIL PROTECTED]>, Rob wrote: >Forgive me please if this is not the proper place for this ? I am trying to >keep an active brain :) Seems proper to me :) You can see what you've just imported by using the built-in dir() function. Here's an example from my PyWin window: >>> dir() [