function check(part){ $(part).toggle(); } </script> """
library = "/home/galible/bss/csv-data" trav = os.walk(library); datarows, datatables, title = {}, {}, {} if selectedfile == "": print " <h1><font color=\"red\">choose the file</font></h1>" for fol in trav: for file in fol[2]: print " <font size=\"5\">>>> </font><a onclick=\"javascript:jumptofile(name)\" name=\""+str(fol[0])+"/"+str(file)+"\"><font size=\"5\" color=\"#FFAA55\">"+str(fol[0])+"/"+str(file)+"</font><font size=\"5\"> <<<</font></a><br>"; else: print "<h1><font color=\"#0055FF\">detail for csv file : </font><font color=\"#FF5500\">"+selectedfile+"</font></h1>" file = open(selectedfile, 'r') datatables = file.readlines() for row in datatables: if title == {}: title = row.split(",") else: datarows[len(datarows)] = row.split(",")
print "change file : <select onchange=\"jumptofile(value)\">" for fol in trav: for file in fol[2]: print "<option value=\""+str(fol[0])+"/"+str(file)+"\" "+((str(file) == str(selectedfile.split("/")[-1])) and "selected" or "")+">"+str(file)+"</option>" print "</select><br>" if command == "": print "Sort by : <select onchange=\"jumptoparam(value)\"><option value=\"\" selected>no sort</option><option value=\"sortidup\">sort id up to down</option><option value=\"sortiddown\">sort id down to up</option></select><br>" if command == "sortidup": print "Sort by : <select onchange=\"jumptoparam(value)\"><option value=\"\">no sort</option><option value=\"sortidup\" selected>sort id up to down</option><option value=\"sortiddown\">sort id down to up</option></select><br>" datarows = sortby(datarows, "up") if command == "sortiddown": print "Sort by : <select onchange=\"jumptoparam(value)\"><option value=\"\">no sort</option><option value=\"sortidup\">sort id up to down</option><option value=\"sortiddown\" selected>sort id down to up</option></select><br>" datarows = sortby(datarows, "down")
print "<table border=\"4\">" print "<tr>" for header in title: print "<td>" + header + "</td>" print "</tr>" for table in range(len(datarows)): print "<tr>" for row in datarows[table]: print "<td>" + row + "</td>" print "</tr>" print "</table>"
ไม่มีความคิดเห็น:
แสดงความคิดเห็น