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
>
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
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
> >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