Page 1 of 1

write file sht 31 (or any other seeed sensor)

Posted: Tue Apr 09, 2019 3:22 am
by r.bunder
Hi,

I would like to have the output of the script grove_temperature_humidity_sensor_sht3x.py to a file.
Can anybody help me?


Kind regards

Remco

Re: write file sht 31 (or any other seeed sensor)

Posted: Tue Apr 09, 2019 6:17 pm
by bill.yu
Hi Remco

For how to save the message to file, please refer to https://www.pythonforbeginners.com/file ... -in-python thanks.

Code: Select all

file = open(“testfile.txt”,”w”) 
 
file.write(“Hello World”) 
file.write(“This is our new text file”) 
file.write(“and this is another line.”) 

file.close() 

Re: write file sht 31 (or any other seeed sensor)

Posted: Thu Apr 25, 2019 5:56 pm
by r.bunder
Thanks that helped!