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

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Spring 2005 Homework 1 Questions

Ask questions about Homework 1 here.





does it matter what picture we choose to posterize? -Lauren Elder
Not really. However, a picture that is very large may take a while to loop through. Greg Leo

When I try to attach my picture, it asks for a username and password in order to connect to coweb.cc.gatech.edu. What should I use for these?
Check out the FAQ. Greg Leo

do we need to attach our picture when we turnin our program?
and do we need to put
file = pickAFile()
picture = makePicture(file)
in the program?
none of the above :) Your code should work on any picture...it takes a picture as an input! This makes codes more universal so you can use them multiple times (you might can use this code on a later homework...). Your TA will grade using a picture of his/her choice and your code should work for anything the TA picks. So, you do not need to put pickAFile() in your program...you assume that when we ask for a picture input, that whoever is running the code will make a picture before passing it into the function. Amanda Bennett

I'm trying to post a picture to the HW 1 Poster Gallery, but when I click on "edit" it asks me for a user name and password. Am I supposed to have one? Thanks - J
check out the FAQ. Amanda Bennett

how do we show the picture that we posterized
You can use show(picture) to make it pop up again or repaint(picture) to make it refresh.

How do we make sure that our program works?
Find a JPEG on your computer or get one from the internet and test your program with it.
>>> file = pickAFile()          Pick the JPEG on your computer
>>> picture = makePicture(file)
>>> posterize(picture)
>>> show(picture)

You should see the posterized picture come up if you did it correctly.



How do we go about uploading the picture we've created with the writePictureTo function?

Go to Spring 2005 poster gallery and click the attach button. It will promt you for a password which can be found in the FAQ . Then browse for your posterized picture and upload it. hope this helps Albert d'Heurle

i am getting an error with one of my lines of code...
if (red > 50 and red = 128):
what is wrong with this?


sorry, i meant to put if (red > 50 and red = 128):
still same question...

Try: if red > 50 and red <= 128:  You don't need the parenthesis.
Greg Leo

Do you remember the difference between = and == from class? Kelly Lyons

I don't think there is anything wrong with my code, but after picking a picture and typing in the correct commands, the picture isn't showing up.
Are your if's indented so that they are included in the for loop?

when I was doing "less than or equal to" in my "if" line, it wouldn't let me put "==" it would only work if I used one equal sign. Am I missing something? Do I need to put and "and" between the two or something?

Even with one equal sign, it does load and change the picture, i'm just not sure in the correct way. - Ian Williams

<= and >= are the correct operators for less than or equal to and greater than or equal to. The whole == thing is to make a distinction from the store value operator, =.

What do we do to upload our picture to the site. I'm confused with the writePictureTo function
writePictureTo takes in the picture variable and a path on your hard drive. So suppose you have a variable pic that you called your posterize function on...
>>> posterize(pic)
Then you would call writePictureTo as such...
>>> writePictureTo(pic, r"C:\somefolderpath\somepicture.jpg")
The path to the picture has to be in quotation marks and when you're using a Windows machine, you need that silly r thing in front of it so that JES doesn't freak out when it sees the \'s.

Do you have to post a picture to the page, and if so could you explain it more in depth because the previous posts arent working for me.

Nope, you don't have to post. But if you do have something like a digital Degas going on (or just something that you're proud of ;), we'd sure like to see it!! - Rachel Burton

Do we have to use if statements or can we use pickfromranges instead?
You can use any code you want as long as you write it and it works :) Amanda Bennett

I am really confused about the writePictureTo function. I just used the advice you gave above and this is what was returned.

>>> file = pickAFile()
>>> picture = makePicture(file)
>>> posterize(picture)
>>> writePictureTo(pic, r"C:\Documents and Settings\Andrew\Desktop\AndrewBryant.jpg")
A local or global name could not be found. You need to define the function or variable before you try to use it in any way.
Did you load your function first? Make sure you do that! also, where did you get pic from? when you run posterize(picture) you may want to set a variable equal to it. try
 posterize(picture)
pic = picture
writePictureTo(pic, r"C:\Documents and Settings\Andrew\Desktop\AndrewBryant.jpg")
Amanda Bennett



Links to this Page