V
vlad_fig
Hello all,
I would like some help with setting up a method that would allow me to change its number of parameters. For example:
#---------------------
class createfile(object):
def __init__(self,
modelName = None,
someLines = None):
self.modelName = modelName
if someLines is None:
self.someLines = []
else:
self.someLines = someLines
def writeStuff(self,
numberParameters = None,
Parameter1 = None,... ??? )
self.someLines .append("yes, we can %s" % self.Parameter1)
#---------------------
file = createfile('file')
file.writeStuff(2,a1,a2)
file.writeStuff(3,a1,a2,a3)
.....
file.writeStuff(n,a1,a2,...an)
I would like some help with setting up a method that would allow me to change its number of parameters. For example:
#---------------------
class createfile(object):
def __init__(self,
modelName = None,
someLines = None):
self.modelName = modelName
if someLines is None:
self.someLines = []
else:
self.someLines = someLines
def writeStuff(self,
numberParameters = None,
Parameter1 = None,... ??? )
self.someLines .append("yes, we can %s" % self.Parameter1)
#---------------------
file = createfile('file')
file.writeStuff(2,a1,a2)
file.writeStuff(3,a1,a2,a3)
.....
file.writeStuff(n,a1,a2,...an)