Thank you very much.It is ok with parenthesis under Ubuntu 11.10 and Python 2.7.2+
On Sat, Apr 28, 2012 at 6:32 AM, Ryan Sears <[email protected]> wrote: > Yep, the ()'s are the regular expression capture directives, then those > are automatically passed to the class function in question. I believe you > can do multiples, but yeah, as Shannon says after you figure out the best > method for passing that stuff around you realize there's better ways to do > it. > > > On Fri, Apr 27, 2012 at 11:26 PM, Shannon Cruey < > [email protected]> wrote: > >> I think your problem may be in the url mapping. Try this: >> >> '/(.*)', 'index' >> >> Note the parens - I think that matters. >> >> For what it's worth (your mileage may vary), I've found I'm not doing >> very much argument passing on the URL once I got going past the >> tutorials. I'm using web.data() and web.input() to get querystring or >> post data the "old fashioned" way. For my jQuery ajax posts, I even >> made a wrapper function: >> >> def getAjaxArg(sArg, sDefault=""): >> """Picks out and returns a single value.""" >> data = uiGlobals.web.data() >> dic = json.loads(data) >> >> if dic.has_key(sArg): >> return dic[sArg] >> else: >> return sDefault >> >> >> and I call it like this: >> xyz = getAjaxArg("myarg") >> >> >> >> On Fri, Apr 27, 2012 at 3:00 PM, murat bilal <[email protected]> >> wrote: >> > >> > Hi Everyone, >> > >> > I am new to web.py and read this tutorial >> http://webpy.org/docs/0.3/tutorial >> > >> > My code is >> > #!/usr/bin/env python >> > import web >> > render = web.template.render('templates/') >> > urls = { >> > '/.*','index' >> > } >> > class index: >> > def GET(self,name): >> > return render.index(name) >> > >> > if __name__ == "__main__": >> > app = web.application(urls,globals()) >> > app.run() >> > >> > But when i go to the url like http://192.168.1.13:8080/Joe >> > I got his error <type 'exceptions.TypeError'> at /Joe >> > >> > GET() takes exactly 2 arguments (1 given). >> > >> > Any Ideas.Please help >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "web.py" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> [email protected]. >> > For more options, visit this group at >> http://groups.google.com/group/webpy?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "web.py" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/webpy?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "web.py" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/webpy?hl=en. > -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
