469,328 Members | 1,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

Re: Python script + v4lctl

En Mon, 20 Oct 2008 06:15:34 -0200, Gatis <ga****@inbox.lvescribió:
I wrote script that in case of some event takes picture using usb
webcam [Creative Live! Cam Vista IM (VF0420)] and command line utility
v4lctl (from package xawtv).
To catch error and info messages from script I used:
sys.stdout = open('/tmp/log','a')
All writes to log file well, except v4lctl error messages. If script
is run from commandline, than v4lctl error messages are shown there.
How to catch these messages?
Use the subprocess module to invoke the external program; see
http://docs.python.org/library/subprocess.html specially the examples at
the end.
When script is run from /etc/init.d (in runlevel 2) during boot, no
pictures are taken. I can't tell error message, because of Problem1.
If I execute now v4lctl from commandline (while my script is running
in background), picture is taken.
Once you start using subprocess, you could write to some file what you get
from the communicate() method - the error messages, if any, should be

Gabriel Genellina

Oct 21 '08 #1
0 641

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

28 posts views Thread by Erik Johnson | last post: by
2 posts views Thread by DeepBleu | last post: by
52 posts views Thread by Olivier Scalbert | last post: by
17 posts views Thread by Paul Rubin | last post: by
3 posts views Thread by krzychu | last post: by
6 posts views Thread by manatlan | last post: by
37 posts views Thread by John Salerno | last post: by
6 posts views Thread by tatamata | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.