Your code looks good congratulations on getting it working.
one point you don't use
Code: Select all
os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
to enable 1-wire interface any more , you just need to run raspi-config and go to interfaces and enable 1-wire from there .