![]() ![]() |
| |||||||||
| This page removed for FERPA compliance | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| You're going to a directory path as input, so it better work for any directory containing JPEG images. Mark Guzdial |
| I fixed that, Justin – thanks! Mark Guzdial |
| It works just like the samples example in class today. We give you the path to a directory as a string. Mark Guzdial |
| Try double-clicking on the file and seeing what is in it, or open it again from JES. Your note is unclear: You made a folder named index.html, but tried to open a file named hw4.html? Browsers can't open folders – they can open files that are in the .html format. Mark Guzdial |
| No, absolutely not. Did you come to class and see the Samples code run? You're building code very much like that. You are not just writing an index.html file – you are writing a program that CREATES an HTML file. Mark Guzdial |
| I did have it in the program, and we discussed this WEEKS ago. It's even in the book – see page 177. It's needed to process all the files in a directory. Mark Guzdial |
| What is the target for the anchors you create? You have to create <a> tags to create clickable-anchors, and you'll use href= to set the target for the anchors. That's what will show it at it's real size. You want those targets to be the actual pictures. Yes, the created HTML should run fine if you create it in the same directory as your pictures – you don't have to upload it to a Web server. Mark Guzdial |
| The nice thing about HTML is that you can just type it into a file and try it. Get the effect you want in plain HTML, then write a program that generates what you wrote. Mark Guzdial |
| Why not the filenames of the pictures? Mark Guzdial |
| Nope – assume an ending of .JPG – that's fine. Mark Guzdial |
| Absolutely – that's what a solution should look like. Mark Guzdial |
| Check the filenames in your generated HTML and in the window (use the detail view). Are they spelled right? Did you grab non-JPG files? Are there issues like spaces in filenames that can confuse HTML? Mark Guzdial |
Filename: "+file
samples=samples+'Filename
| The problem is that you've placed "Filename" as the anchor text, what's clickable. You need the IMAGE be what's clickable. (I showed how to do this in class this morning, and talked about it on Monday.) Mark Guzdial |
| Of course it can be a totally different way! That's fine! Mark Guzdial |
| Exactly. Mark Guzdial |
| No need to apologize! That's what this page is for! Mark Guzdial |
| I don't care. Whatever you'd like. Mark Guzdial |
| No, the anchor should take you to the picture. My guess is that you forgot the filename in the href. Mark Guzdial |
| We'll be testing on our own directories. It should work for any reasonable number (say, a few hundred). Mark Guzdial |
| Look at your HTML. What do the href's look like? Do they have the names of the pictures? If they don't, that's why you're getting the erorr that you are. Mark Guzdial |
| ME, TOO! Mark Guzdial |
| Check your quotes. The file/" should probably be file+"/. There are similar errors elsewhere in that line. Mark Guzdial |
| Huh? Try again, please. What's "here"? What "blank picture"? Mark Guzdial |
| It should create an HTML page that you can then open in a browser to see what it looks like. Mark Guzdial |
| You have to get the string addition right. "blah"+"blah" will you give you "blahblah". "blah" "blah" (no +) will give you an error that it doesn't look like Python. Mark Guzdial |
| It's okay to set it like that, but then you'll get square icons that don't look like the original picture. Mark Guzdial |
| You changed a space or a "+" or a quote somewhere. You can send me the file and I'll look at it, but you definitely did change the file. Mark Guzdial |
| Then look very carefully at each line and make sure that the quotes match and that you only have plus signs between strings. Mark Guzdial |
| Not sure how to answer this. Did you come to class and watch me do this in class? Mark Guzdial |
| Try using "\" instead of "/" - Jose |
| Nope – I ran the samples program several times in a row, making modifications each time. You can run it as often as you like. Mark Guzdial |
| Why hate yourself? YOU FIGURED IT OUT! YOU RULE! Mark Guzdial |
| "I can't read as Python" has nothing to do with the input. Check your code very carefully to make sure that quotes and parentheses match. Mark Guzdial |
| REMOVED, don't look at HW4.py in IE. Look at the .html file you created in IE. Browsers understand HTML, not Python code. Mark Guzdial |
| The anchor line? What do you mean? Mark Guzdial |
| Kelly, 404-894-5618 is my office number. I'll be here for another 20 minutes or so. Mark Guzdial |