chrt_ventesArticles.Series[Conversion.Texto(f_cursor.Campo(1))]["PixelPointWidth"] = Conversion.Texto(Math.Round(chrt_ventesArticles.ChartAreas[0].InnerPlotPosition.Height, 0));
如何将 class main_prg:
def func():
# code that generates x and y
return x,y
def func1(x):
#uses the value of x that is returned from func()
z=x+3
return z
传递给x
?
我试过了
func1()
给我一个错误m=main_prg()
f01,f11 = m.func()
f2 = m.func1(f01)
答案 0 :(得分:0)
这可以为您提供所需的输出。您必须将self
添加到类中的每个函数。
class main_prg:
def func(self):
# code that generates x and y
x = 1 # whatever
y = 2 # whatever
return x,y
def func1(self, x):
#uses the value of x that is returned from func()
z = 3 # whatever
return z
m = main_prg()
f01,f11 = m.func()
print f01
print f11
f2 = m.func1(f01)
print f2
f01
打印1
f11
打印2
f2
打印3