mercredi 10 février 2016

why the print result is "favicon.ico" in web.py

I have a question about web.py.

The following is the example code from web.py tutorial. I added a print row into the code as print name. run python test.py, and then open http://ift.tt/1o5q39L in the brower, you will see "hello baby" in the html page. However, in the terminal, you will see the print result is "favicon.ico".

I know favicon.ico, but I am pretty confused about why it doesn't print "baby".

Can someone explain this for me? Thanks to everybody~

import web

urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())

class hello:        
    def GET(self, name):
        print name
        if not name: 
            name = 'World'
        return 'Hello, ' + name + '!'

if __name__ == "__main__":
    app.run()




Aucun commentaire:

Enregistrer un commentaire