I have this code:
import vlc
from time import sleep
from multiprocessing import Process
def lul():
song = vlc.MediaPlayer("Himeringo - Shinitai-chan.mp3")
song.audio_set_volume(50)
song.play()
sleep(5)
while song.is_playing():
print('&')
sleep(5)
if __name__ == '__main__':
k = Process(target=lul)
k.daemon = False
k.start()
And when I execute it, main process keeps running: Picture
I'm sure that highlighted guy is main
, because when I added a while True loop that was printing things at the end and then killed this guy, it stopped printing this things (but proceeded with printing &s) and continued playing the song
My goal is to keep process with song alive, while there is nothing else running. And the main continuing as zombie isn't what I want.
I can kill it manually, and the song will keep playing, but that is not the way.
So, the question is: why main process stays alive when it reaches end line? Once I divided by zero, but it continued as zombie despite that fact: Picture