You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to use your module to import some stored data and programmatically
add rows as new information comes in. I am having trouble specifying the order
of the columns as they are created.
I have modified your createData() function as:
def createData():
data = {}
serials = [ '3456', '2343', '2345' ]
colnames = [ 'Serial', 'IP', 'Name' ]
for sn in serials:
data[sn] = {}
ips = ['172.26.2.1', '172.26.2.2', '172.26.2.3']
names = ['Test1', 'Test2', 'Test3']
i=0
for sn in serials:
data[sn][colnames[0]] = serials[i]
data[sn][colnames[1]] = ips[i]
data[sn][colnames[2]] = names[i]
i+=1
return data
The problem I am finding is that the IP column is the first column, rather than
the serial number. How can I switch the order of these columns at the start of
the program?
Thanks,
Patrick
Original issue reported on code.google.com by pfarrel...@gmail.com on 3 Mar 2013 at 4:31
The text was updated successfully, but these errors were encountered:
This is not a real problem in the programm. It's rather that dictionaries have
no fixed order. So you could rearrange the columns like that.
yourTableModel.moveColumn(yourTableModel.getColumnIndex('columnName'),
desiredColumnIndex)
This worked for me.
I hope I could help. :)
Original comment by LGurki...@gmail.com on 8 Jun 2013 at 1:36
Original issue reported on code.google.com by
pfarrel...@gmail.com
on 3 Mar 2013 at 4:31The text was updated successfully, but these errors were encountered: