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 PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Midterm Exam 2 Review Spring 2006: WhooooOOOooo


I see this on several different example. What does str(frame) of str(num) stand for or do?

str converts any given input into a string. -Blake O'Hare

How about having a directory as an input; do I set it before or just type in the name of the folder?

either would work. remember when you "set it before" you're just putting that name into a variable to be used later. Amanda Bennett

does the text move around in a V shape? down from the left and then back up on the right? it creates 100 frames with the string on each of them?
Almost. Check the direction the text is moving again. Try plugging in values to see what you get for x and y. -poof #10

What does num == str(frame) do? and what does the line under it do?
The line actually reads... num = str(frame) but look at this line... writePictureTo(canvas, directory + '//frame' + num + '.jpg') and think about what the variable 'num' is right there. The line under that is an if statement that is just testing a condition. If the LHS is equal to the RHS, then it executes the code that is indented underneath it, if not, it skips it and moves on. -poof #10

It's an upside down V hahahahaha!

range(100) returns [0,...,99] which is 100 numbers. Thus there are 100 frames

In writePictureTo(canvas, directory + '//frame' + num + '.jpg')

what is the significance of canvas?
How else would Python know which picture to write to the file? Colin Potts

i know this was asked but it wasnt answered: so does it create 100 frames since its range (100) and not range (1,100) which would be 99 frames?

also "What do the frame names look like?" is it 1-9 frame0#.jpg and frame 10> frame#.jpg? 


"i understand the if statement, but what does len(num) == 1 do, besides add a variable that is added to where it's written"
It makes it so there is a 0 infront of frames with length of one digit. This is done so the frames are in a nice order 01,02, . .09,10




i understand the if statement, but what does len(num) == 1 do, besides add a variable that is added to where it's written

Link to this Page