Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

CD Drive Constantly Opening ported to python - Python Code Bank


CD Drive Constantly Opening ported to python
there is a program in the visual basic code bank that constantly opens the CD drive. This is the same one, only in python.
                import ctypes, time

while 1:
  ctypes.windll.winmm.mciSendStringW(u"set cdaudio door open", None, 0, None)
  time.sleep(5) #in seconds
  ctypes.windll.winmm.mciSendStringW(u"set cdaudio door close", None, 0, None
)

#if python3.x > instead of mciSendStringw, use mciSendStringA. 

#as stated in the other post, to use a message box something like win32gui.MessageBox(0, "message here", "title", 1)
#for messages i belive it requires pyWin32 module. But when compiled via py2exe you could bunndle the files.
            
Comments
Sorry but there are no comments to display