import time
class Video(object):
def __init__(self,path):
self.path = "C:/Program Files (x86)/QuickTime/QuickTimePlayer.exe"
def play(self):
from os import startfile
startfile(self.path)
class Movie_MP4(Video):
type = "MP4"
movie = Movie_MP4(r"C:\Users\A\1.mp4")
movie.play()
如果將「C:/ Program Files(x86)/QuickTime/QuickTimePlayer.exe」更改爲路徑,我可以使用此代碼播放Windows Media Player文件。如何通過Quicktime播放器打開.mp4視頻?
如何快速播放我的視頻?
Startfile應該採取的MP4輸入作爲它的參數,而不是玩家exe文件 - 它應該能夠找出哪個應用程序可以與文件類型一起工作,因此你不必這樣做。 – mdurant 2014-10-06 18:00:05
視頻採用exe文件的路徑,並播放視頻。如果我chnaging vidoe路徑quicktime .exe – user583088 2014-10-06 18:38:28
是的,我看到Viedo有exe文件的路徑,你將它傳遞給startfile - 我告訴你,這是錯誤的做法。見答案。 – mdurant 2014-10-06 19:00:29