473,320 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Not defined

Rob
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 "<interactive input>", line 1, in ?
NameError: name 'Sphere' is not defined b=Box(name="Cube", pos=(1.5,2,0)) Traceback (most recent call last):
File "<interactive input>", line 1, in ?
NameError: name 'Box' is not defined


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

Oct 1 '05 #1
5 3645
In article <RV*********************@news.xtra.co.nz>, 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() ['__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?

--
Pekka Henrik Karjalainen

Oct 1 '05 #2
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 "<interactive input>", line 1, in ?
NameError: name 'Sphere' is not defined


Which version of cgkit are you using?

Kent
Oct 1 '05 #3
I looked around a bit and found the answer. At least the change I
recommend below worked for me.

In article <RV*********************@news.xtra.co.nz>, 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 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.

--
Pekka Henrik Karjalainen

Oct 1 '05 #4
Rob
Thanks for the replies gives me something to chew on.

Regards Gramps
Oct 1 '05 #5

[Rob]
from cgkit import *
Sphere() 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:
import cgkit
print cgkit.__file__
dir(cgkit)


--
Richie Hindle
ri****@entrian.com
Oct 3 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dave | last post by:
Hello all, Please consider this code: #ifndef FOO_INCLUDED #define FOO_INCLUDED // File: foo.h class foo {
2
by: David Emme | last post by:
Access 97 I have a number of SELECT statements which contain references to user-defined VBA functions. These typically work as expected, but occasionally, on one user's machine or another,...
3
by: Leiji Liu | last post by:
Hi, I am curious if there are any pre-defined varables (constants?) in C? I saw some code with __LINE__, __FILE__, etc. Are those located in some include files? LL
19
by: E. Robert Tisdale | last post by:
In the context of the comp.lang.c newsgroup, the term "undefined behavior" actually refers to behavior not defined by the ANSI/ISO C 9 standard. Specifically, it is *not* true that "anything can...
7
by: William L. Bahn | last post by:
I'm working on some lessons and want to be sure I get some stuff correct. If any of this is covered in the FAQ, please feel free to point me to the section - I couldn't find it. ...
6
by: Michael B Allen | last post by:
Which is the preferred method for preprocessor tests and why? #ifdef XYZ or #if XYZ or #if defined(XYZ) and
4
by: Rui.Hu719 | last post by:
Hi, All: I read the following passage from a book: "There are three exceptions to the rule that headers should not contain definitions: classes, const objects whose value is known at compile...
1
by: sethuganesh | last post by:
HI, i have ported vc++ 6.0 code to visual studio 2005. During batch build in debug mode i din't get any error.But if i build the same in release mode i am getting the following error. ...
2
by: curious2007 | last post by:
During the linking I get the following: 1>Linking... 1>main.obj : error LNK2005: "double __cdecl sigma(class curious2007::pair<double,double> const &)" (?sigma@@YANABV?$pair@NN@curious2007@@@Z)...
7
by: skillzero | last post by:
Is there a way to cause a compile/preprocessor error in a macro if a preprocessor symbol is not defined? I want to do the equivalent of this in a macro: #if( !defined( SOME_FLAG ) ) #error not...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.