I have a list that is retrieved with python from MS Access.
This list needs to be sorted alphabetically before being printed on the web browser.
Here is what I have and I need it sorted by the P_LastName.
dbc = odbc.odbc('Intra//')
csr = dbc.cursor()
q = "SELECT P_ID, P_FirstName, P_LastName, P_Company, P_Title FROM contacts WHERE P_Category = '%s'" % cat
csr.execute(q)
pdt = csr.fetchall()
csr.close()
I have been playing the with sort function but have been unsuccessful. Any help greatly appreciated.