Python help: Sending a "play" command to quicktime, or playing a movie in python
Chris Rebert
clp2 at rebertia.com
Fri Oct 23 18:17:40 EDT 2009
On Fri, Oct 23, 2009 at 3:07 PM, Varnon Varnon <varnonzero at gmail.com> wrote:
> I'm sure this is a simple problem, or at least I hope it is, but I'm
> not an experience programer and the solution eludes me.
>
> My realm of study is the behavioral sciences. I want to write a
> program to help me record data from movie files.
> Currently I have a program that can record the time of a keystroke so
> that I can use that to obtain frequency, duration and other temporal
> characteristics of the behaviors in my movies.
>
> What I really want, is a way to start playing the movie. Right now I
> have to play the movie, then switch to my program. I would love it if
> it were possible for me to have my program send a message to quicktime
> that says "play." Or any other work around really. If python could
> play the movie, that would work just as well.
>
> I'm using a mac btw.
>
> Any suggestions?
import subprocess
subprocess.Popen(["open", "path/to/the/movie.file"])
Docs for the subprocess module: http://docs.python.org/library/subprocess.html
For information on the Mac OS X "open" command, `man open` from Terminal.
Cheers,
Chris
--
http://blog.rebertia.com
More information about the Python-list
mailing list