Not defined

R

Rob

When trying the basic tutorial for cgkit I always seem to get a not defined
error as follows.

Pythonwin GUI
Traceback (most recent call last):
Traceback (most recent call last):

I am useing ver 2.4

A little help would be most appreciated.

Forgive me please if this is not the proper place for this ? I am trying to
keep an active brain :)

Regards Gramps
 
P

Pekka Karjalainen

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() ['__builtins__', '__doc__', '__name__', 'pywin']
from math import *
dir ()
['__builtins__', '__doc__', '__name__', 'acos', 'asin', 'atan', 'atan2',
'ceil', 'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'floor', 'fmod',
'frexp', 'hypot', 'ldexp', 'log', 'log10', 'modf', 'pi', 'pow', 'pywin',
'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh']
Note that the first time I use dir() it lists just four items. After from
math import * it lists all the stuff I got from the math module in
addition.

How does your dir() look after the import statement?
 
K

Kent Johnson

Rob said:
When trying the basic tutorial for cgkit I always seem to get a not defined
error as follows.

Pythonwin GUI



Traceback (most recent call last):
File "<interactive input>", line 1, in ?
NameError: name 'Sphere' is not defined

Which version of cgkit are you using?

Kent
 
P

Pekka Karjalainen

I looked around a bit and found the answer. At least the change I
recommend below worked for me.

When trying the basic tutorial for cgkit I always seem to get a not defined
error as follows.

Pythonwin GUI

This is "from cgkit.all import *" in the tutorial here:

http://cgkit.sourceforge.net/doc2/node6.html

It seems the tutorial you are using is out of date vis-a-vis the version
of cgkit you use.
 
R

Richie Hindle

[Rob]
Traceback (most recent call last):
File "<interactive input>", 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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top