Nov-07-2018, 04:06 PM
Well, val_dB is a float. You explicitly made it one on the second line (although given that you made it a float and then made it a string on the previous line, I'm a little confused as to the process). Floats don't add to strings, you need to convert it back to string to do that:
myfile.write(date_ID + " " + val + str(val_dB) + "\n")Better yet is to use string formatting:
myfile.write('{} {}{}\n'.format(date_ID, val, val_dB)That will do the conversion for you, and allows for all sorts of ways to format the resulting string. You can see the full format method syntax here.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures