I am generating some numbers(lets say, num) and writing the numbers to output file using outf.write(num). But compiler is throwing an error:
outf.write(num).
any of these should work
outf.write("%s" % num) outf.write(str(num)) print >> outf, num