Ligne 228 : |
Ligne 228 : |
| Disk = subprocess.check_output(cmd, shell = True ) | | Disk = subprocess.check_output(cmd, shell = True ) |
| | | |
− | # Ecrire deux lignes de texte | + | # Ecrire quatre lignes de texte |
| draw.text((x, top), "IP: " + str(IP), font=font, fill=255) | | draw.text((x, top), "IP: " + str(IP), font=font, fill=255) |
| draw.text((x, top+8), str(CPU), font=font, fill=255) | | draw.text((x, top+8), str(CPU), font=font, fill=255) |
Ligne 234 : |
Ligne 234 : |
| draw.text((x, top+25), str(Disk), font=font, fill=255) | | draw.text((x, top+25), str(Disk), font=font, fill=255) |
| | | |
− | # Display image. | + | # Afficher l'image sur l'écran |
| disp.image(image) | | disp.image(image) |
| disp.display() | | disp.display() |
− | time.sleep(.1) | + | # pause de 100 millisecondes |
| + | time.sleep(.1) |
| </syntaxhighlight> | | </syntaxhighlight> |
| + | |
| + | {{traduction}} |
| | | |
| Using the subprocess class, python can utilize linux commands to access the Pi's system information. This loop updates the screen at 10 times a second.<br><br>That's all there is to the '''stats.py''' code! | | Using the subprocess class, python can utilize linux commands to access the Pi's system information. This loop updates the screen at 10 times a second.<br><br>That's all there is to the '''stats.py''' code! |