![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| I believe its all on the static webpage. - Bobby Mathew |
| Unless its extended in the last minute, its still due on Thursday - Bobby Mathew |
| You can use pic = makePicture(file) and then do getHeight(pic) - Bobby Mathew |
You can use the <table>tag and then use <tr>for each row and <td>for each column in the row. - Bobby Mathew |
Look up the str function. It will be of use to you for this part. -Blake O'Hare |
| hmm.......that isn't specified. For now, I guess you should have a minimum of 4 rows (media items), at least 2 pix and 2 sounds. If there are any changes, I'll post it here and on the announcements page. - Bobby Mathew |
| I got confused on the previous answer. For the previous post, your code should generate the table for the media items in the folder which the TA checks with. So, when I test your code, the table should be formed based on the number of media items in the folder I choose. So, your code should be according to that. Sorry about the confusion. - Bobby Mathew |
There'll be an outline of a table only if you specify a border (i think). The <table>tags shouldn't be in any loop. It should be written to the file only once. - Bobby Mathew |
| Put a statement count = count + 1 within the 'if' condition. And also you have to initialize count = 0 before the loop starts. So, count keeps track the number of media items. -Bobby Mathew |
| media. The other part was taken from last semester. - Bobby Mathew |
Use the <table>tags. - Bobby Mathew |
| Didn't understand the question. - Bobby Mathew |
| Either the code in the book is wrong or there might be some assumptions that they make when doing it. - Bobby Mathew |
| You can use the open command. file = open(dir + "//media.html", "wt"). dir is the directory you passed in as the parameter, media.html is the name of the file you need to make (it will create one for you if you already don't have one) and 'wt' is the mode you want to open the file in. In this case, its the 'write' mode. - Bobby Mathew |
| Email your code to a TA. - Bobby Mathew |
If you don't have a file.close() somewhere after you open it, it won't actually create the file. -Blake O'Hare |
str doesn't actually go in the HTML code, it's part of the python code. You use it to add calculated numbers to the end of your code. For example, when you count up how many media files are in the folder, you need to add that to your HTML code. The line to do that would look something like this... code = code + '<p>Files here: ' + str(num_files) + '</p>'-Blake O'Hare |
wrap getLength(sound) with the str function. -Blake O'Hare |
You need to keep a running tally of the jpegs and waves and after you close your table, you need to add that number to the end of your HTML code. -Blake O'Hare |
Usually "blankness" happens when you don't close the file connection after you finish writing everything to it. -Blake O'Hare |
| It means you didn't put an r in front of the path: print os.listdir(r"C:\Documents and Settings\Owner\My Documents\newfolder") |