Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Spring 2003 Take Home Exam 2

Ask procedural questions, ONLY here on Take Home Exam#2

REMINDER: This is a NON-COLLABORATIVE ACTIVITY! You may not talk to anyone about their code, nor look at anyone else's code, nor allow anyone to see your code. This is a TAKE HOME EXAM. It is an "open book" exam. You may use your book, any slides, any material in the CoWeb, and any programs you've written (even with others) that you already have direct access to.

Ask questions here but be sure to ask questions only about objectives and process. You are welcome to ask questions about any of the programs in the book or in the slides, but you cannot ask anyone (even the TA's or teacher) about your own solution.

Comments or questions?



Within the code we are using, I can't figure out how to pull out the height and width of the picture or the length of the sound. Are there any suggestions you can give on how to do this?
Check JES Help or the book. Mark Guzdial

In the unordered list we have to have, does it matter if you actually use <ul> or does it just matter that the items are bulleted?
You must use <ul> Mark Guzdial


do we have to have the "Filename: " before we list the link in the list or is that just in the example to help us? Jessica Dickerson
Yes, you must have it. Mark Guzdial

I keep getting this in my file.close() line, and i know it is indented right, I have been fiddling about with it and I have checked the indentations of all my other lines and completely re wrote the line but i still get that... what next?
>>> There was a spacing error in the program.
It might be from a previous line, but I think the error is in line 31
Sarah Cormack
Try increasing the indentation. Instead of using 2 spaces per indentation level, try 3 or 4. I find that helps me to find indentation errors easier, and in moving to the new level, I usually fix the problem. Mark Guzdial

oops samplesfile.close... but none the less it still isnt working...

so, i am having a horrible time with the unordered list part - we didn't see many exmaples, and theres not much in the notes.....I'm kinda lost on where it goes...and how I woudl do
  • for every item in the directory - and have it applicable to all directories.
    Try some <ul> examples in plain HTML files to make sure you understand it before trying to write your program. Try using it in JES to make sure that you understand it. Mark Guzdial

    the list thing is in the notes, i am having a hard time getting it to print the pixel number or seconds. is anyone else having problems with this? jessica

    yes! i can't get it to print the pixel number or seconds either...i don't know how to do it

    to do have it display the height and the width should we use the functions getLength, getHeight, and getWidth? I wasn't sure of this since that function take a sound as imput and I didn't think we could put in input since each file is different?
    Yes, use those functions. You will already have to use IF to figure out if the file is a sound or a picture, so just use makePicture or makeSound once you know if it's a sound or a picture. Mark Guzdial


    i tried that and i got another error that said i was trying to pass an argument as a function or something, it was being wierd. i tried all different ways to use those functions last night and i am still at a loss. jessica dickerson
    I just tried to do it, and it worked fine for me. Use lots of print statements to figure out what you're sending where. Mark Guzdial

    for the length in seconds does it need to be rounded to a certain number of decimal points or a whole number?
    Nah – just put it out however it comes out. Mark Guzdial

    When i do print length i get a pretty big number. Is that in seconds or do we have to change it? Susan Holloman
    It sounds like you have the equation wrong, since all of our sounds are less than 10 seconds long. Mark Guzdial

    When I put the <ul> into my program it indents each file listing but there is no bullet. What can be causing this?
    Are you including list items in the list, by using <li>? Mark Guzdial

    OK I am going to try to ask this quesiton so that you can answer it and it is not directly related to the exam. If I have a statement in my code like "number = 23" how can I put "number" in my code so that on my HTML page "23" is printed? I hope you can answer this. I havn't found any such examples in the noted or book. #9
    Use the function str(). Str() takes a number and returns a string. We've used it in lots of the examples the last few weeks. Mark Guzdial

    ok, it still says trying to pass an argument as a function, it says that there is no file such as "barbara.jpg"
    help, i don't know what i am doing wrong
    jessica dickerson
    There is no file on your disk named "barbara.jpg". There may be a file on your disk named "C:\Documents and Settings\Jessica Dickerson\My Documents\mediasources\barbara.jpg" Mark Guzdial

    it is actually counting the pixels, however i am getting this error message
    An attempt was made to call a function with a parameter of an invalid type
    what does that mean
    jessica dickerson
    It means that you are calling a function with an input that that function can't make sense of. It can happen if you call a function with no inputs that expects one, or if you call a function for sound with a picture input. Mark Guzdial


    i don't think that is the case, i can get it to print the height in the black area in jes, i just can't get it to print into the html code. ahahahahhahhhhhh. i am lost. jessica dickerson
    Jessica, you may not think it's the case, but it must be. If it works in the command area, it can work in the program area. Programming is a humbling activity – you have to accept that there's a mistake someplace, and just work at it to figure it out. Mark Guzdial

    Can you point me to an example in the lecture slides or somewhere that str() is used. I am having the same problem.
    How about every one of the movie examples? Check how the file name is made for the frames. Mark Guzdial

    what is str()
    A function that returns the string representation of a number. Mark Guzdial

    Yeah I am having the same problem as Jessica. If i have print statements I get the numbers. But the numbers wont show up when i try to tell it to show them in the HTML line. It seems like we should put parenthases or somthing to let it know to show the number that it is finding. But I can't figure out how to do that. #9

    JES Help says that getLength "Takes a sound as input and returns the number of samples in that sound." What gives us the length of a sound in seconds. Or are those two the same?
    Recheck the sound lecture. The number of samples is not the same as the length in seconds. Mark Guzdial

    I'm having the same problem of not getting it to come up in html. I think I know where to insert it in the body, but I dont know what commands to use. I have used all kinds of variations with print, quotes, and +'s. I don't know where to go.
    Think it through slowly. Make the program work with just PART of what you need. Then add another part and make it work there. Then add more and make it work there, until you're done. (Read over the Design Lecture on bottom-up design.) Mark Guzdial

    Do we need to use something like image.Load() then image.Height() ??? Student86
    Absolutely not. Mark Guzdial


    I have my links in an unordered list, each one has a bullet, but each one is idented more than the rest. Any suggestions?
    "Each one is indented more than the rest"? How can every one be indendent more than every other one? Mark Guzdial

    I have used makePicture and makeSound to turn my files into both sounds and pictures based on the if statements, and when I print this, I am given a height and widht of hte pictures as well as a lenght of the sound. I cannot figure out how to put these lenghts into the HTML. I have tried using getHeght, getWidth, getLenght, and used various combinations of ", ', +, =, (). I know this question is similar to above, but I kinda wanted to emphasize the problem. Any suggestions?
    Yes. Use the str() function to turn the numbers into strings. Add them into your HTML strings using "+" (Remember "Hello,"+"Mark"?). Write the result to an HTML file. Actually come to lecture so that you can ask questions there, see the examples, and hear my explanations of things, rather than just read them off the slides. Mark Guzdial


    So far, I have my program bulleted, but they are not staced one on top of the other... they go down the page in a diagonal pattern... what did i do wrong??!!
    Sarah Cormack
    You have <ul> INSIDE the loop, so that you create a new ordered list each time, instead of just having a line item. Mark Guzdial

    I am SOOOO confused... i don't see why I am getting this error... if there is a file then how can there be no file?
    >>> indexREMOVED(directory)
    makePicture(filename): There is no file at 640x480.jpg
    An error occurred attempting to pass an argument to a function.
    Please check line 78 of C:\Documents and Settings\Sarah\My Documents\CS 1315 programs\exam2a.py
    Did you use setMediaFolder, Sarah? Did you use getMediaPath, then, to get the correct path to 640x480.jpg? Mark Guzdial

    I'm with everyone else. I'm just trying to start by getting the width and height and length before even trying to make that show up in HTML - and I can't even do that!!! How do you get the program to fill in the right (full) file name? This is several hours of work behind me and I don't even have a clue, even though it's just dealing with Python.
    Again, start out slow. Make the basic program work. Then add one additional feature. Make that work. Then add one additional feature. Make that work. Grow your program, don't expect it to work all at once. It doesn't work all at once for me, and I've been doing this for awhile! Mark Guzdial

    I mean I understand what the problem is - it can't do any getHeight etc. operations to a file that it can't find and that it can't find that file because I haven't entered it properly, but how do you enter it properly? I've tried a lot of different ways, but the problem is getting both the directory and the file to show up separated by their neat little \ and it's just not happening.
    Lauren Biddle
    Don't use "\". Use "//" as discussed in class. (We talked about you and your Midterm Review problem in class yesterday, Lauren. Shoulda been there – it was good stuff!) Mark Guzdial

    The python stuff with height and width mixed with pulling it up in html - That's the real kicker...I'm stuck there


    I am still not understanding how to get the length in seconds.
    It's very explicitly in the lecture slides. Mark Guzdial

    WOOOOOHO I got the str() to work. Thanks a lot!! #9

    Alright, Prof Guzdial - I am stumped (again). I see what you mean about making sure the the complete filename is used with makePicture(if you don't know what I am talking about, see Lauren Biddle's comment above), and I have my program set-up to do that, but I am missing the part where you set and get the mediaPaths. I have no idea where to put that! Does it go in both of the IF loops? Can I set it at the beginning of the code? Any suggestions would be much appreciated! Brittany Selden
    Do the setMediaFolder() in the command area BEFORE executing your function. The TA's will know to do that. Use getMediaPath() to create a complete path to your files. But see my comment at the bottom of this page – I'm not sure why anyone is using getMediaPath() in this problem. You ONLY need to grab files out of the input directory, not out of the media folder. Mark Guzdial

    I did use // when I was testing it all. No dice. I also tried the getMediaPath and setMediaPath stuff. I obviously don't understand how those functions work because these were no help either.
    Lauren Biddle
    (sorry I didn't come to lecture. I did want to see that, but I was working on this problem too late on Sunday night to wake up in the a.m.)
    Take a look at all the movie code examples. They use directory+"//"+filename over and over again. If you can get that code to work (and maybe use print statements to see what file is being opened), then maybe it'll help you figure out your code. Mark Guzdial

    Alright, now I'm extrememly confused. It is saying that no file exists at a certain location (one of the pictures inside my directory). However, when I added a print function before that, it does print the location correctly, and a picture does exist there. So why does the program believe that there is nothing there?
    Either you're not printing the EXACT same thing that you're trying to open, or the file isn't really there. Don't make the mistake that Luke asked about in class last week. If "C:\MyDirectory\myfile.jpg" exists, getMediaPath("C:\MyDirectory\myfile.jpg") will most certainly NOT work. getMediaPath() will add a whole "C:\directorystuff" before the filename given as input. If you're using a complete directory path, do not ALSO use getMediaPath(). Mark Guzdial

    Ok, so i figured out how to stop the files becoming a diagonal list rather than a straight one, but I am really having major issues with showing height and length. When I do get media path etc. it wont even let me load and when i set the folder myself it says There is no file at 640x480.jpg
    An error occurred attempting to pass an argument to a function.

    suggestions?
    Sarah Cormack
    Don't use getMediaPath. I can't think of a reason you'd want to use it here. You're not trying to get content out of a centralized media directory. You want to get files out of whatever directory was input. Mark Guzdial

    I'm having the same problem that someother people are. JES keeps telling me that my files do not exist although they are there. I haven't made any of the errors that you pointed out earlier. So I don't know what I'm doing wrong. It also says in the same error message that I am trying to pass an argument as a function. What does that mean? Student88
    Did you use r before the string? Did you print them before you used them to make sure what they are? Mark Guzdial

    Ok- I know that you have tried to explain unordered lists and you also said to look in the notes, but I can't find a good enough example to help me understand it. I still have no clue where to actually put the "<ul>" and "<li>" in the code. Got any advice? :)
    Put the "<ul>" before the loop, the "<li>" at each element in the loop, put "</ul>" after the loop. Mark Guzdial

    apparently it can be done on the coweb but not in jes...

    In my index.html file, i have the wavs and jpgs going down in a colon. Under the jpgs is a tiny little square that when you click on it shows you the image. Is this suppose to be bigger like they were in homework #4?-REMOVED REMOVED
    There should not be any images at all. If you're using <image> tags, you're doing it wrong. Mark Guzdial

    I have my ul and li commands inside the for loops. I just start and end them bith for each file. Is that ok?
    No, that would be wrong. That would be creating multiple unordered lists instead of just one. Mark Guzdial

    OK, I may have missed this when you answered it for someone else, but I have to whole picture thing working (and I have turned it into an actual picture so the imput should be correct), but when I try to get height(pic), it still says that :An attempt was made to call a function with a parameter of an invalid type... Does that make sense and can you help me with it? Student117
    Try showing the picture, Summer, and make sure that the makePicture worked. getHeight should then work. Mark Guzdial

    My code works, but I have a small problem. I dont know how to convert the sound waves to seconds. I have the length of the sound printed, but I cant seem to find out to get it into seconds. :( Purposely blank
    You know how to get the length in samples, and you know how to get the number of samples per second (getSamplingRate). From there, you should be able to figure out the number of seconds – it's algebra. Mark Guzdial

    oh wow this is terribly difficult... at least the getting this program to show the height width and/or sound of the files... :\
    It's not really – but it probably is if you're only trying to get your homework working. Make two of the HTML programs work on your computer, then make one of the Movie programs work on your computer. If you can get those to work, AND UNDERSTAND THEM, you should be able to figure out the exam. Mark Guzdial


    you don't care if there are extra print commands here and there right? Student86
    Not at all! In fact, we should consider making that worth extra credit – it demonstrates debugging skills and that you really worked to understand the program! Mark Guzdial

    I know you have explained this many different times and different ways already, but I'm in the same place as Katie. Even with using the getSamplingRate I don't understand how to turn the samples into seconds. I looked at past lecture slides but I didn't see how to do it.
    getLength returns the length in samples. getSamplingRate returns the number of samples per second. x samples and y samples/second. You want z seconds. This is algebra. Mark Guzdial

    is it ok that my list is indented from the left of the screen? (all of the files/links are aligned with each other, just not all the way to the left) Does this mean I did my list wrong?
    Yes, it does mean that you did it wrong. Look at the answers above for the same question. Mark Guzdial

    I showed the picture and printed it–both of which worked correctly–but I still get the problem with my paramter of invalid type thing–for getWidth(pic) and getHeight(pic) (I set it equal to pic when i did makePicture(directory"+//+"file)). Student117
    Summer, did you mean makePicture(directory"+//+"file)) or did you mean makePicture(directory+"//"+file))? Mark Guzdial

    Also, we don't have to use getMediaPath() and setMediaFolder do we? Because I haven't been? Student117
    Like I said above, I don't why you would. Mark Guzdial

    I can make the html page, anchors, links, unordered list, etc. However, I am still have a ridiculous amount of trouble with the getlength,width,height. I can actually make it work in the command area of jes, but it just isnt working or showing up on my html page. i know this may have been sked before, but i honestly dont know what to do .... im completely lost any suggestions? thanx!
    Did you try the suggestions earlier? Putting in print statements into your code to see what's being opened? Using str()? Make it work WITHOUT getLength etc., then add ONLY ONE of them, get that working, then add in the rest? Mark Guzdial


    I got it!!!

    Does the sound length has to be in seconds? I managed to get the length but not in seconds.

    Yes, it must be in seconds. (Well, it can be in samples, but then you'll lose points. Mark Guzdial


    Yeah!! I finally got it all–except for one thing. My first bullet of a file (like the first line that says Filename: blah blah blah) is indented more than all the others (everything else is aligned on the right margin). Any suggestions?


    By the way that was Student117

    OK, scratch that question, I messed with it a little bit and got it fixed!! Student117

    Summer rules! Mark Guzdial


    Is it okay if the seconds is like 20 characters long?
    It depends. Is it just a really long decimal, but looks like it's about right lengthwise? Sure. If it's a number greater than 10,000? No. Mark Guzdial

    Prof., could you post the two sample examples you did at the beginning of class this morning? The ones you worked with as far as making the link correct on an index.html page, where you made the filename a link and where you made a link under the filename. Thanks
    Nope, sorry – that's a "lecture-only feature." Mark Guzdial

    I have tried everything possible for the getHeight including the dirrectory // file thing but it just isnt working in the actual html file... how much will it count off if we dont get it because im on the verge of giving up- someone help!!!
    If you receive any help on this other than from me on this page, you may not submit your exam. There has been plenty of help on this page and in lecture. Work through these answers and see if you can figure it out. Mark Guzdial

    I was testing my html page, and when I click on the jpg file name, the picture comes up, however, when I click on the .wav file name, it says that windows says I don't have permission to open this file...does that mean that it's not working (I feel like it must be working cause it is giving me the length in seconds) or does it mean that my sound card doesn't work? -Lyndsay Fry
    Check your HTML file. Is the href right? If so, your browser just isn't configured properly to play the sound. Mark Guzdial

    i hear that, this is ROUGH...

    Another thing (this is Lyndsay again) The <ul> simply adds the black dots next to the filename, correct?
    They're called "bullets" Mark Guzdial

    The <ul> is just supposed to add bullets right? Not indent. If that is wrong any suggestions? #9
    As mentioned in class, check the Sandbox page to see how it's supposed to look. Mark Guzdial


    Please help, I went to class today and saw how to get the pictures in the directory. So when I makePicture() it works and getHeight() and getWidth() also work because when I put print Pic Height and Width it works for every file in the directory. But I still can't figure out how to make it just print the number in html. Any help.
    Rolo
    Rolo, think str(). Mark Guzdial

    HELP!!! I have tried to add the unordered list and it keeps telling me that I am "trying to access part of the object that does not exist."
    What does this mean, it's the first time I get this and now it wont stop.
    You're using dot notation, or you're passing the wrong kind of object as input, or you've messed up where your parentheses are and Python is trying to interpret the HTML as Python. Mark Guzdial


    I hope you get this before you leave....I am having a very hard time using the filename= directory + "//" + file thing you showed in lecture today. I keep getting an error when I try to makePicture after this....PLEASE HELP!
    If you're getting an error, then your directory or file variables aren't set correctly. Mark Guzdial

    Ok—I'm getting close but it would be so helpful if I could see what it's supposed to look like. Is there anyway to do this?? I just want to see how my things should be bulleted and indented.
    Try it in the Sandbox. Mark Guzdial

    Thank you, I was using dot notation,
    Rolando


    RE: OK, I may have missed this when you answered it for someone else, but I have to whole picture thing working (and I have turned it into an actual picture so the imput should be correct), but when I try to get height(pic), it still says that :An attempt was made to call a function with a parameter of an invalid type... Does that make sense and can you help me with it? Student117
    Try showing the picture, Summer, and make sure that the makePicture worked. getHeight should then work. Mark Guzdial

    i did the same thing and then i put show and it would show the picture but it still comes up with the error "An attempt was made to call a function with a parameter of an invalid type" i just have it getting the height of the picture that i made so i don't know why it's saying that.

    OH HO I GOT IT NEVER MIND THE ABOVE THING.

    I was using dot notation so I stopped but it still wont work. I went to class today and tried to make the unodered list like you should in class today, but I can't get it right no matter what, it can't read it as python. Any suggestions?
    Rolo
    Think about it slowly, putting in print statements to see what's going on. Obviously, since you saw me do it, it's possible to do. You need to just slow down and think it through. Mark Guzdial

    Ok I think I got it into seconds. This is my question: do we have to show the algebra of what we did or can we just do it and print it on there? I figured out how to convert it to seconds, but I don't know if I know how to show it in HTML. Also, can I add more details? So instead of it just saying: Filename: ..., width..., height—can I add extra stuff just to show my steps and what I did?
    Your steps are in your program. You're turning that in. Why do you need to show it in HTML? Mark Guzdial

    eek i cant figure out how to get the samplingrate into seconds. or rather i dont know how to put it into my program. because i can do the simple algebra but yeah.... and ideas as to help? Whitney Watts
    You really should be able to do that. Why don't you try different formulas? Make a sound, play it so that you know roughly how long it is, then get the length and the sampling rate, and try different equations of the two until you get a number that makes sense to you? Mark Guzdial

    I can't get it to print the width and height and filename on the same line . . . I can get it to print on different lines, but not on the same one.
    <p> and <br> tags are the ones that force different lines in HTML. Remove the extra ones. Mark Guzdial

    So I have EVERYTHING except that the first line is not a link, it is just in plain text... what did I do wrong there?
    Sarah Cormack
    I'm sorry – I can't tell. Check your code and compare it to what you generated. Mark Guzdial

    Did you guys see that up there? He used my name! Granted it was talking about a mistake I made, but...still...
    Student157
    Luke, even in a class of 120, you stand out! :-) Let's not call it a mistake you made – let's call it an interesting question you raised. Mark Guzdial


    So the only thing that needs to be a link is the name of the file.

    I am almost positive that my function is correct. Why won't it convert the numbers over in my HTML file instead of it just being, getHeight(pic)+getWidth(pic)?-REMOVED REMOVED
    REMOVED, I've answered this many times now. str(). Mark Guzdial

    I am having the same problem as REMOVED... can anyone help??
    See the same answer as REMOVED's. Mark Guzdial

    Do we need to put anything around the getHeight and getWidth to make them work in html? I've tried everything from brackets to parenthesis to quotations, but all that ever shows up on my index.html page is the getHeight and getWidth statements. It won't print the numbers!! :/
    Take them out of the quotes. Mark Guzdial

    Jes is telling me that the height and width of my pictures are -1 so it is unable to load the pictures.
    You're trying to make a picture out of something that isn't a valid JPEG picture. Mark Guzdial


    should our .JPG and .WAV be capitalized or should they be lowercase?
    Capitalized should work. Mark Guzdial

    i know you have answered it, i just thought I was having a different problem then what they were describing, sorry.-dave

    I asked the question about the height and width being -1, but my picture are barbara.jpg, and sunset.jpg. They should be greater than this.
    Did you move to a new computer? That sounds like an old version of Java. Mark Guzdial

    Ok this may be a stupid question, but I was tryin to open an old assignment as reference for this take home exam, and it wont let me open it in JES. It has changed the name of the file and put my gt adress in front of it in JES, and made it a zipped file when I try to open it outside of JES....any suggestions?
    Unzip it via Winzip at http://www.winzip.com – your homework will be inside the zip. Mark Guzdial

    I GOT IT TO WORK!!! :D

    i have tried the str() and it is not working....

    Just want to be sure I understand the assignment: It says in the exam that clicking on the filename should display that file. Does that mean it should display the actual image or the filename? And clicking on the filename of the sound should play the sound? Just want some clarification. Also, I know that you want a heading for the page, but what about a title of the page? Do you want one? or does it matter if it's the same as the heading?
    Show the actual image and play the sound (if configured correctly). The title doesn't matter. Mark Guzdial

    Im was just wondering if the T.A's are allowed to help us in any way on the take home exam- I'm not sure whether I should go to recitation and ask for help or stay here and work by myself- just asking so i dont accidentally break any rules :)
    No, they cannot. Mark Guzdial

    Halle-(expletive deleted)-lujah!!!

    I've got everything working but my bullets are showing up as hallow circles instead of filled black dots, am i doing something to make this happen? I'm using <ul> and <li>. Thanks
    Could be just how your browser shows unordered lists, or you've nested your lists (i.e., you have two <ul>'s). Mark Guzdial

    I am also having the problem with getting -1 as my pixel values. I know it means that its not a valid picture, but I don't see how it isn't! Its saved as a .jpg. What else could be wrong with it? Student88
    Not all .jpg are created equal. Try opening it in your browser and see if it works there. Can you open ANY JPEG's? Have you moved computers? Do you need to re-install Java? Mark Guzdial

    I can't even remember if we can do this in JES (I think we can), but would you like for us to round the length of the sound so that instead of printing out 4.483310683483 seconds, it shows 4.48 or something like that?
    I'm not worried about it. Mark Guzdial

    Grrr, when I use "'+somefunction(picture)+' in my program, when I run it, it generates HTML that reads somefunction(picture) instead of giving me the number it should have gotten...do you know why Professor G.?
    Student157
    Your quotes are wrong. Check them. You have that code inside quotes inside of outside them. Mark Guzdial

    Luke, try surrounding ONLY the things you want to show up exactly as typed in quotes - anything JES has to manipulate before it is written to HTML should not be surrounded by quotes. So it would be..."some words" + somefunction(picture) + "some more words"
    Brittany Selden
    Like Brittany said. Mark Guzdial

    Does it not work the other way around? Because when I write Width is I get Width is in html, and when I write "Width is" I get "Width is" in html. If its like you say that wouldn't happen right?
    Student157

    oh yeah, I used italics and bold so you wouldn't get confused on the quotes...hope that works for ya.

    HTML doesn't understand any functions. Only Python does. You want Python to do the processing, not treat it like a string (just a bunch of characters). If you want the result of the functions, it has to be OUTSIDE of quotes. If you want the function to appear as text, put it INSIDE of quotes. Mark Guzdial


    arrrgh! Outside of quotes JES still doesn't do the function and its still read as just being specific text to write letter for letter. i.e. +str(getWidth(picture))+ gives me exactly that instead of JES doing the function. How can I make it do the function?
    Student157

    I still don't get the str()!!!! I've tried to put it in there and it doesn't work! I've tried getHeight and getWidth. Do you have to combine these functions? If you do, then why does Python keep telling me that there is no file at 640x480.jpg????

    Ok, so putting one little ' around the function made it work. I'm so confused as to why, BUT....I'm not gonna argue, if the program wants to work, then I'm outta here! Time to go LATIN DANCIN YEAH!!
    Love to you all!
    Student157

    i am so happy, i just got this thing to work. just thought i would put that because i was so frustrated earlier

    makePicture(filename): There is no file at 640x480.jpg

    Why does it keep giving me this? I don't understand how there can't be a file at 640x480.jpg

    You said earlier that when we do the unordered list it should not indent a little to the right. But in the sandbox example it is idented a little to the right.
    It does indent some – depending on your browser. If each list item indents MORE than the one before, you've nested your <ul> and put it in the wrong place. Mark Guzdial

    I've tried using print to find out what the variable "file" does, and according to that, 640x480.jpg is a file. Why won't it work??????
    This is answered earlier. You have no file named 640x480.jpg on your disk. You have a file named C:\Documents and Settings\your name\My Documents\mediasources\640x480.jpg on your disk. You need a complete path. You can get that from your Directory. Mark Guzdial


    .Re: Soapbox posting. I check the CoWeb quite frequently. If you need your questions answered next time, start earlier!. Mark Guzdial.


    fixed the file problem, now when I perform my operations, it's reporting "None" as the answer on my page. Why?



    Link to this Page