![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| You can find the username and password you are looking for in the FAQ on the coweb Kelly Lyons |
| You must calculate the average yourself by getting the values of the green and the blue components of the pixel and adding them and dividing by 2. For examples, look at the greyscale function from class. That is averaging 3 components. Use the same idea, but only average the two components, green and blue. Kelly Lyons |
| Are you having trouble before or after the writePictureTo part? -Blake O'Hare |
| If I'm wrong, then another TA please correct me, but I'm pretty sure the TAs will do the makePicture() part in the command area before we run your code and you don't have to put that in. No, you don't have to include the writePictureTo(). We would actually prefer you NOT to because it won't run on our computer because the path name is specific to your computer. -poof #10 |
| That's correct. Making picture and writePictureTo should both be done in the command area. Kelly Lyons |
| After you call your program, take the picture variable that you passed in and send it to writePictureTo with a path and filename... >>> colorEffect(picture) >>> writePictureTo(picture, 'C:\\Documents and Settings\\you\\Desktop\\llama.jpg') Something like that. -Blake O'Hare |
| The problem could be where you're trying to create the picture. I'm assuming you have getPixels placed directly in the for loop syntax. getPixels would be the only instance of passing an argument to a function, so the problem is with the picture. Are you sure you're passing a picture and not a file to your hw1 function? -Blake O'Hare |
| By "file" I mean the string that pickAFile() returns and by "picture", I mean the returned value of makePicture -Blake O'Hare |
| You could try using the pickAFolder() command to find what folder you want to put the file in. Then tack the desired filename on to that. -Blake O'Hare |
| Fixed. Everyone, please be careful while posting. If the body of the page looks "odd" in any way before you add your entry, hit refresh, then add it. (Especially if you use a Mac or other non windows OS) -Blake O'Hare |
NOOOOOO!!!!! The appearance of any of the following in your code will result in death:
-Blake O'Hare |
Perhaps I was a bit harsh in my last statement. The following will result in your TA shaking his/her fist angrily at you:
|
| Show, repaint, and print are unnecessary. They exist for the purpose of testing your code. You add these to your program to make sure that it works, but you generally remove them before your program is final. If you left them in your program, it will not affect your grade. The reason makePicture, and pickAFile should NOT be in your function is because your function is supposed to take a picture as input. This means all the making of the picture will happen in the command area. If you are finding yourself needing to use these in your function, then you are not understanding the idea of input. Speak to a TA about this so that they can clarify things. Input is an important concept to understand. writePictureTo should not appear in your program because that will most likely cause it to crash when your TA runs it. Your TA will not have the same filepath on his computer that you have on yours and so it won't run correctly. This would cause you to lose points on your assignment. It is ok to put it in your program to get your picture saved on your computer. Simply remove it before you submit. None of this will cause your TAs to be angry or mean. We DO understand that some of these things might be confusing to some of you. If you are confused about any of this, please speak with a TA so that we can help clarify things. We're not as scary as Blake is making us seem. He's simply a bit overzealous. Kelly Lyons |
| Please still come to my office hours. :/ -Blake O'Hare |
| Same way you turned it in the first time. It'll automagically overwrite your first submission. -Blake O'Hare |
| Yup. -Blake O'Hare |
| What is the exact error message that it gives you now? - Jonny Aguillard |
| Make sure that you are getting and saving your original green and blue values before you do any kind of comparrison. If you do not do this, your second comparrison between the green and blue will compare the new values instead of the original values when you want to be comparring the originals. Kelly Lyons |
| You can find the password you are looking for in the FAQ on the coweb. Kelly Lyons |
| no, use <, >, <=, >=...if you see a necessity for ==, than use it, but i'm pretty sure you can write the code without it. Amanda Bennett |
| It's written in the assignment what you should name it Kelly Lyons |
def colorEffect(picture):
for pixels in getPixels(picture):
redValue=getRed(pixels)
if redValue > 128
setRed(pixels,255)
else redValue <= 128
setRed(pixels, 0) | COLONS! And the syntax for else is wrong. -Blake O'Hare |
| This is correct. The .py file extension is not associated with anything so to view what you submitted you have to open JES and then open the file through JES Albert d'Heurle |
| That is fine. Albert d'Heurle |