I'm trying to make a program that checks when a cd is inserted with the specific name "PlayMe" and then have the program play the one track on it. The computer is a raspberry pi4 with raspbian.
I have tried just scanning for when the file tree appears, and it works once but when the disc is physically removed it still has the tree.I have also tried using pygame's cdrom method to get_empty
and get_name
. I don't know of a better way to do this.
import pygame
pygame.init()
print(pygame.cdrom.get_count())
pygame.cdrom.get_empty(0)
When it gets run I get the output from the cdrom.get_count
as 1 but the get empty gives:
"AttributeError: module 'pygame.cdrom' has no attribute 'get_empty'"