简体   繁体   中英

Endless loop on Raspberry Pi

Device: Raspberry pi 3a+ After installing python3 on Raspberry Pi os, I opened interpreter on terminal and ran below code

a = "abc"
while True:
    print(a)

And my raspberry pi os is completly deleted. I tried to format sd card on Windows but it only reads my sd card as 30MB disk, originally is 16GB. Several trying but same result and finally it was almost burning and splited.

Is it too dangerous to run endless loop on Raspberry Pi os?

This is not dangerous. You're just running an infinite loop that's printing a on the terminal. Hit CTRL + C on the interpreter shell and the infinite loop will be interrupted due to a KeyboardInterrupt .

Running Python infinite loop on rasp pi would definitely not delete your OS. Can you record any action after you run that on the command line?
If you are sure you would like to format your SD card, you may consider using Disk Management tool on Window to format your SD card to full capacity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM