[Tutor] is there a better way to do this?

Chris Roy-Smith chris_roysmith at internode.on.net
Mon May 9 04:13:32 EDT 2016


Hi
Python 3.4 Linux (ubuntu)

This code does what I want.
curs is the result of a mysql query


data = [[" " for x in range(9)] for y in range(count)]
for (ddate, mood, walk, lag, sleep) in curs:
         data[row][0]=ddate
         data[row][1]=mood
         data[row][2]=walk
         data[row][3]=lag
         data[row][4]=sleep
         row +=1


While I don't know a better way to do this, it seems a bit awkward, is 
there a better way?


Thank you
Chris Roy-Smith


More information about the Tutor mailing list