lundi 27 novembre 2017

Python loop and if statment weird issues

Ok, I dont understand what is happening. I am looping over output from my query. A pretty normal loop and if. The issue is when I try to do results[o] < 30. It does not print out the variable. There are column data less than 30 for some reason they don't print. Even if I print a string. Nothing happens. The else statement will print but not the if. On my flask template I have similar code and it works. What am I doing incorrectly. The results[0] is of type int. So I don't know what the issue is. I am not getting any errors.

    for recordset in return_stored_procedure:
        results.append(dict(zip(sp_column_names, recordset)))
        if results[0]['days_column'] <= 30:
           print variable
        else:
           print variable

Aucun commentaire:

Enregistrer un commentaire