When I run this code, I get results like:
(3205, Decimal('1.000'))(28802, Decimal('7.000'))(3106, Decimal('1.000'))(3173, Decimal('5.000')).
I don't want to see the "decimal" word included in the output, how do I avoid this?
cur.execute('SELECT tk_product_ord, SUM(tk_qty_ord) as qty_required '
'FROM table1 WHERE tk_date = 15047 AND tk_prod_group = 11 '
'GROUP BY tk_product_ord;')
answer = cur.fetchall()
file = open("test_data_output.txt")
with open("test_data_output.txt", "w") as line:
for item in answer:
line.write("%s\n" % str(item))
file.close()