with previous result and list containing cull_num, respectively as arguments. call the method cursor.execute with string "DELETE FROM %s WHERE cache_key < %%s" as argument,
cursor . execute ( "DELETE FROM %s " "WHERE cache_key < %%s" % table , [ cursor . fetchone ( ) [ 0 ] ] )