472,142 Members | 1,305 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

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 693

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.