0
我只想類中訪問some_object你好:DEF GET()PyThon如何將對象傳遞給另一個類?
from wsgiref.simple_server import make_server
import web
urls = (
'/(.*)', 'hello'
)
class hello:
def GET(self, name):
return some_object
if __name__ == '__main__':
data = []
some_object = ParentObj.func(data)
app = web.application(urls, globals())
app.run()
@S。洛特:責怪該類的web.py教程,並且爲方法指定web.py本身,而非OP。 – geoffspear 2011-02-23 18:46:23
some_object是ParentObj.func(數據)的一個實例 – 2011-02-23 18:46:54
做什麼???????? – 2011-02-23 18:47:00