Hey!

I read this code that I found on http://webpy.org/images:

import os
class images:
    def GET(self,name):
        ext = name.split(".")[-1] # Gather extension

        cType = {
            "png":"images/png",
            "jpg":"image/jpeg",
            "gif":"image/gif",
            "ico":"image/x-icon"            }

        if name in os.listdir('images'):  # Security
            web.header("Content-Type", cType[ext]) # Set the Header
            print open('images/%s'%name,"rb").read() # Notice 'rb' for
reading images
        else:
            web.notfound()


The GET method there doesn't have a return. I find this very strange.
All the examples I've seen so far has a return statement. Why is there
not one here?

-- 
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.

Reply via email to