Why does a small script keep using 70% + cpu after executing?
I'm very new to Python, but it doesn't make sense to me, here's an example script:
import pygame as py
import time
py.init()
song = py.mixer.Sound("pineSiskin.wav") # c1Mb/20sec long
song.play(0 , 9000)
time.sleep(8)
song.fadeout(800)
py.quit()
print("quit")
By doing this on a Raspberry Pi *, the processor reaches 75% and stays there until I restart the Python shell. This soon leads to overheating on the RPi. Other questions ( like this one and others mentioned in the link ) are different from each other as they refer to unfinished scripts. This link is indeed hinting that what I am seeing is not "normal" behavior.
Any help tracking down this issue / diagnosis would be helpful.
Sorry if I made a mistake about which forum; tell me and I'll translate it!
* Hardware / Software:
- Raspberry Pi 3 Model B works
- Raspbian jessie pixel
- Python 3.4.2 access via IDLE3 Python 3.4.2 bundled with scipi and matplotlib added
+3
source to share