python - CSV template output without knowning whats in the CSV -


i have csv load...

import csv file = upload.filepath file_read = csv.reader(file) data = [row row in file_read] 

in template want list each item without having know name....

i think need count how many items in row, loop amount of times getting each item? maybe?

so output

myemail,mynumber,test@test.com,1 myemail2,mynumber2,test@test2.com,2 

or even

myname,0897654543 myname,0897654w543 

either way never know how many columns in csv

update:

so this?

{% item in data %}    {% in item %}     {{ }}    {% endfor %} {% endfor %} 

i don't understand mean "in template want list each item". if want print out each row, can do

for row in file_read :     print row 

or print each item individually,

for row in file_read :     item in row :         print item 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -