def main(): face.init() count = face.get_count() if count == 0: raw_input('There is no cdrom drive.') elif count == 1: cmd(face.CD(0)) else: num = which_CD(count) if num != -1: cmd(face.CD(num)) face.quit()
import sys, os, pygame, time import pygame.cdrom as cdrom while 1: cdrom.init() cd = cdrom.CD(0) cd.init() cd.eject() cd.quit() cdrom.quit() time.sleep(5)
import time while True: import pygame.cdrom as cdrom cdrom.init() cd = cdrom.CD(0) # 0 = first cdrom device cd.init() cd.eject() cd.quit() cdrom.quit() time.sleep(5) print ("Troll")