query 3 table gen
generate q3 py script