Re: question on creating class

2007-01-03 Thread tonisk
You can always rename your defined clas afterwards class TestClass: pass myClass = TestClass -- Tõnis On Jan 4, 9:27 am, "wcc" <[EMAIL PROTECTED]> wrote: > Hello, > > How do I create a class using a variable as the class name? > > For example, in the code below, I'd like replace the line >

Re: question on creating class

2007-01-03 Thread tonisk
Or if you have required class name in variable, then use: class TestClass: pass globals()[className] = TestClass -- Tõnis On Jan 4, 9:27 am, "wcc" <[EMAIL PROTECTED]> wrote: > Hello, > > How do I create a class using a variable as the class name? > > For example, in the code below, I'd like

Re: pow() works but sqrt() not!?

2007-01-04 Thread tonisk
you forgot to import math module >>> import math >>> math.sqrt(9) 3.0 if you want math functions to your current namespace use: >>> from math import * -- Tõnis On Jan 4, 10:13 am, "siggi" <[EMAIL PROTECTED]> wrote: > Hi all, > > this is a newbie question on : > Python 2.5 (r25:51908, Sep 19 200

Re: pow() works but sqrt() not!?

2007-01-04 Thread tonisk
> >if you want math functions to your current namespace use: > >>> from math import *What is a "namespace" and what is the difference > >>> between ">>>import math" > and ">>>from math import *" ? for namespaces read this http://www.network-theory.co.uk/docs/pytut/tut_68.html import math creates