如何在python中存储动态对象

时间:2014-11-30 10:29:01

标签: python class object

我有一个班级和一个n*n表。我想为表的任何字段创建具有不同名称的对象。例如objects11objects12objects31取决于表格的x,y。我怎么能这样做?

class Variables():
    def __init__(self,earn,cost,able,x,y,analogy):

        self.earn = earn
        self.cost = cost
        self.able = able
        self.x = x
        self.y = y
        self.analogy = analogy

0 个答案:

没有答案