Is it possible to initialize the argument of a method with a self.variable value from __init__ in python?
问题 I have a class with an __init__ method where I define some variables, as well as a method AddSignalSpectrum : class SpectrumGraph: # Properties def __init__(self): self.PlotHeight= 300 self.PlotWidth = 800 self.xRangeMin = -10 self.xRangeMax = 10 self.yRangeMin = -0.1*(self.xRangeMax - self.xRangeMin) self.yRangeMax = 0.9*(self.xRangeMax -self.xRangeMin) def AddSignalSpectrum( self, name, Type, CenterPosition, Bandwidth=2, Height = self.yRangeMax*0.8, Color = "#0000FF", LineWidth = 2,