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

Template3

# Template to get and show a picture file;
# Loop through a range of pixels and do something to them;
# Do something with new picture
def <function name>():
  #Part 1 - Get and show a picture file. Choose from Template1.
  file = '<file name>.jpg'
  picture = makePicture(file)
  show(picture) <or openPictureTool(picture)>
  
  #Part 2 - Loop through picture and process each pixel.	
  for x in range(<start_x>, <stop_x>+1, <step_x>):
     for y in range(<start_y>, <stop_y+1>, <step_y>):
       <do something to each pixel>
  
  #Part 3 - Do something with new picture
  repaint(picture) 
  <or openPictureTool(picture), writePictureTo(picture, path)>


Link to this Page