[python-win32] COM works from IDLE but not when file executed from Windows Explorer

new2com python_nabble at fah-consulting.co.uk
Mon Mar 5 10:21:59 CET 2007


Installed: Python25, pywin32-210.win32-py2.5.exe
Being new to COM, I have a simple question. When I execute the following
code from within IDLE, I hear the mp3 file played out but when I run the
file from Windows Explorer I get no sound (and no errors) ?

I'm sure the answer is very simple !

( http://www.nabble.com/file/6954/playFile.py playFile.py ):

from win32com.client import Dispatch

if __name__ == "__main__":
    mp = Dispatch("WMPlayer.OCX")
    tune = mp.newMedia('my_file.mp3')
    mp.currentPlaylist.appendItem(tune)
    mp.controls.play()
    raw_input("Press Enter to stop playing")
    mp.controls.stop()

-- 
View this message in context: http://www.nabble.com/COM-works-from-IDLE-but-not-when-file-executed-from-Windows-Explorer-tf3347619.html#a9308083
Sent from the Python - python-win32 mailing list archive at Nabble.com.



More information about the Python-win32 mailing list