write file sht 31 (or any other seeed sensor)

Applications/questions using Raspberry Pi with Seeed products, please post it here.

Moderators: lily.li, violet, salmanfarisvp

Post Reply
r.bunder
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Tue Apr 09, 2019 3:19 am

write file sht 31 (or any other seeed sensor)

Post by r.bunder » Tue Apr 09, 2019 3:22 am

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

bill.yu
Elementary-5
Elementary-5
Posts: 597
Joined: Mon Apr 02, 2018 11:05 am

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

Post by bill.yu » Tue Apr 09, 2019 6:17 pm

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() 

r.bunder
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Tue Apr 09, 2019 3:19 am

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

Post by r.bunder » Thu Apr 25, 2019 5:56 pm

Thanks that helped!

Post Reply