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

Fall 2006 Midterm 2 Review: Poking at your hard drive

Post your questions here.

folder-string, object
files-list, object
file-string, object
foo-number, object
bar-string, object

>>>print bar
*says to print everything after the first (.)
ex: if it was os.listdir(folder) it would be .listdir(folder)


Stacy Schwaiger
Remember that rfind searches backward from the end of the string, so foo is the position of the last dot. In the example you give, there's only one dot, so the result is the same anyway. Given that bar = file[foo:], what then is the value of file, and what comes after its last dot? Colin Potts

>>>print bar
This will return the file extension (.jpg, .wav, or whatever) of the first file in the folder.

David Poore
Yes - Bobby Mathew



Link to this Page