C
codecraig
Hi,
I have a question about how to define constants.
My directory structure looks like...
C:\
--> abc.py
--> utils
--> __init__.py
--> CustomThing.py
Ok, CustomThing looks like...
TOP = 0
LEFT = 1
class CustomThing:
def __init__(self):
self.foo = "foo"
so, from abc.py I have
from utils.CustomThing import CustomThing
print CustomThing.TOP
but i get an error: AttributeError: class 'CustomThing' has no
attribute 'TOP'
How can I access those??
Thanks.
I have a question about how to define constants.
My directory structure looks like...
C:\
--> abc.py
--> utils
--> __init__.py
--> CustomThing.py
Ok, CustomThing looks like...
TOP = 0
LEFT = 1
class CustomThing:
def __init__(self):
self.foo = "foo"
so, from abc.py I have
from utils.CustomThing import CustomThing
print CustomThing.TOP
but i get an error: AttributeError: class 'CustomThing' has no
attribute 'TOP'
How can I access those??
Thanks.