On Feb 25, 2:42 am, dineshv <[EMAIL PROTECTED]>
wrote:
> I want to display images on a web page.  All the (*.jpg) image files
> are in the /static/ folder.  The following code:
>
> > imagePath = 'C:/blahBlah/static/'
> > imageName = 'moreBlah.jpg'
> > print open(imagePath + imageName, "rb").read()
>
> prints out gibberish.
>
> Also tried:
>
> > imagePath = '/static/'
>
> and that results in a File Not Found error.
>
> Any thoughts?

try this:
imagePath = '/static/'
imageName = 'moreBlah.jpg'
print "<img src='%s'>" % ImagePath + ImageName

the same should work for you with <script> and <link> tags.
once you put the files in '/static' folder you don't need to
open().read() them, web.py does it for you.

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