Skip to content

Instantly share code, notes, and snippets.

@leotada
Last active July 15, 2018 21:56
Show Gist options
  • Save leotada/75295ed7e8bfccd2619e to your computer and use it in GitHub Desktop.
Save leotada/75295ed7e8bfccd2619e to your computer and use it in GitHub Desktop.
Python open CD driver on Windows - Abrir drive CD no Windows
# Exemplo pra abrir e fechar porta do driver de CD no windows. Python2:
from ctypes import *
import time
print("opening....")
windll.winmm.mciSendStringA("set cdaudio door open", None, 0, 0)
time.sleep(5)
print("closing...")
windll.winmm.mciSendStringA("set cdaudio door closed", None, 0, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment