array in class

2008-05-13 Thread alefajnie
class A: this_is_original_variable_only_for_one_inctance = 0 def __init__(self, v): self.this_is_original_variable_only_for_one_inctance = v class B: this_is_common_for_all_instances = [] def __init__(self, v): self.this_is_common_for_all_instances.append(v)

Re: what does int means for python ?

2008-05-11 Thread alefajnie
> > try arr[2][3] instead. > > basically your version is trying to index an array with a tuple argument > (2,3). > > --irmen oh, you're right. btw, is any simple way to create multi-dimension array ? any built-in function ? -- http://mail.python.org/mailman/listinfo/python-list

what does int means for python ?

2008-05-11 Thread alefajnie
#!/usr/bin/env python arr = [[0 for c in range(0, 10)] for r in range(0, 10)] # 10x10 array arr[2,3] # throws TypeError: list indices must be integers arr[int(2), int(3)] # also throws TypeError: list indices must be integers !

Graphical grammar in python

2008-04-13 Thread alefajnie
hi Is exist any graphical library with resize, rotate, shape recognition, ...? suitable for graphical grammar at this moment I have OpenGL (resize & rotate) and recognition solved as saved set of shapes (classes) feel free to write down any ideas :) -- http://mail.python.org/mailman/listinfo/py