Feb-09-2024, 09:58 AM
Sorry, I don't understand.
I believe you want to put the path and names of video files in an html table. Is that correct?
These names are just strings, not the actual files. So I am not sure where you are getting 60K from??
html is just a text file. So create the html table as a list, then ''.join(html_list).
You need something like these basic tags to make the html table list. In my case, the formatting is done in separate css files (which you can also generate using Python!)
glob.glob() above produces a list of 4 lists, 1 list for each type of video file you want.
If you loop through these lists, appending each list element to a list like dataTable = [], below, according to the number of columns you want, just replace X in '<td>X</td>' with each path or file in the lists. Add <tr> and </tr> to each row.
Finally, you join dataTable
Most of the time I do this starting with a text file of words or phrases in English and Chinese, so my tables usually only have 2 columns.
I believe you want to put the path and names of video files in an html table. Is that correct?
These names are just strings, not the actual files. So I am not sure where you are getting 60K from??
html is just a text file. So create the html table as a list, then ''.join(html_list).
You need something like these basic tags to make the html table list. In my case, the formatting is done in separate css files (which you can also generate using Python!)
tableStart = '<div class="div-table">\n<table>\n' rowBegin = '<tr>' if header[0] == 'False': tableHeader = '<td>X</td>' elif header[0] == 'True': tableHeader = '<th>X</th>' tableData = '<td>X</td>' rowEnd = '</tr> \n' tableEnd = '</table><br> \n </div><br> \n \n \n' numCols = int(numberColumns[0])
glob.glob() above produces a list of 4 lists, 1 list for each type of video file you want.
If you loop through these lists, appending each list element to a list like dataTable = [], below, according to the number of columns you want, just replace X in '<td>X</td>' with each path or file in the lists. Add <tr> and </tr> to each row.
Finally, you join dataTable
newTable = [] newTable.append(tableStart) for i in range(0, len(dataTable)): newTable.append(dataTable[i]) newTable.append(tableEnd) # join the list to a string, write the string to your html newTableString = ' '.join(newTable)Write newTableString to your html file.
Most of the time I do this starting with a text file of words or phrases in English and Chinese, so my tables usually only have 2 columns.