From d86a007cecf0efb785b858f2f4847495439ea0ee Mon Sep 17 00:00:00 2001 From: Terho <35961163+Naapi@users.noreply.github.com> Date: Fri, 28 Jun 2019 09:22:07 +0300 Subject: [PATCH] Basic update script for Raspberry Pi (#32519) Python update && upgrade script for Raspberry Pi --- guide/english/python/raspberry-pi-basics/index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guide/english/python/raspberry-pi-basics/index.md b/guide/english/python/raspberry-pi-basics/index.md index 22ac063f06..90498ee96d 100644 --- a/guide/english/python/raspberry-pi-basics/index.md +++ b/guide/english/python/raspberry-pi-basics/index.md @@ -2,6 +2,18 @@ title: Rasberry PI Basics --- +## Update your Raspberry Pi + +With os.system(), it is possible to write shell commands and run the apt-get update and upgrade. +``` +import os + +def install_updates(): + os.system('sudo apt-get update && sudo apt-get upgrade -y') + +install_updates() +``` + ## Rasberry PI Basics Example ```python ## CODE THAT MAKES AN LED GLOW FOR 2 SECONDS