-3
class index:
def GET(self):
return 'hello'
def POST(self):
data = web.data()
parse_data(data)
display()
def parse_data(data):
data_part=["abc","bcd"]
return data
def display():
data= "here i want to use the same data variable that was sent from parse_data()"
def main():
app = web.application(URLS, globals())
app.run()
display()
if __name__ == "__main__":
main()
我想通过在蟒蛇其他功能其余没有使用类访问的变量来访问,我该怎么做?我正在尝试使用与其余函数一起使用的变量。用户定义的函数变量由Python中的其他功能其余没有使用类
你想要哪个变量来访问? – Nilesh 2014-11-04 10:31:41
为什么你不使用参数和'返回值?你有'B',为什么不在'A'和'C'中? – jonrsharpe 2014-11-04 10:33:01
@ jonrshape-我已经编辑了上面的代码,我试过使用返回语句,但不返回值 – Zumbaa 2014-11-04 10:44:20