To allow beginners to run Python code anytime and anywhere, we added the feature to run Python code on our public account shortly after its creation. Today, let’s take a look at the hardware that has been silently serving our public account!
This is the hardware board that is only the size of a credit card, famously known as the Raspberry Pi. The Raspberry Pi is a low-cost development board developed by the UK charity “Raspberry Pi Foundation”. Due to its low price and powerful functionality, it is loved by many enthusiasts. Currently, it sells for around 250 yuan in China. Although small, it is fully equipped and runs a powerful Linux operating system. With it, hardware enthusiasts can unleash their unlimited imagination and create freely.
Shortly after creating the public account, we burned the Linux operating system onto the Raspberry Pi, installed Docker, and created a Python service image. The backend applications of the public account are implemented entirely in Python, using the Flask lightweight web framework. The entire Python service runs in a Docker container, which can prevent any mischievous classmates from formatting the backend system one day. To avoid affecting everyone’s normal use, if you know some hacking techniques, please do not play pranks on it.
The Raspberry Pi can work continuously every day without power interruption. If there are no special notifications in the public account, it will keep running 24 hours a day. You may not believe it, but this continuous operation only requires 3 kilowatt-hours of electricity per month!
The backend functions of the public account are still being improved, and there are more fun features waiting to be explored. Let’s try out the Raspberry Pi backend; be ready to copy and paste the following code:
####### Copy the following code ######
### The simplest Hello World print
print('Hello World!')
#### Paste it into the input box below the public account and click send #
####### Copy the following code ######
### Simple multiplication
a = 128
b = 256
print(a*b)
#### Paste it into the input box below the public account and click send #
####### Copy the following code ######
print([i*100 + j*10 + k for i in range(1, 5) for j in range(1, 5) for k in range(1, 5) if (i!=j!=k and i!=k)])
#### Paste it into the input box below the public account and click send #