Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- from pathlib import Path
- import sys
- devicepath = "/sys/bus/w1/devices/"
- devicerawtempfile = "w1_slave"
- with Path(devicepath, sys.argv[1], devicerawtempfile).open() as rawtemp:
- _, templine = rawtemp.readlines()
- _, tempinc = templine.rstrip().split("=")
- print(int(tempinc) / 1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement