python - NameError: name 'subprocess' is not defined -


i'm trying make rng website: http://jamesdotcom.com/?p=417. when run following code:

captureimage = subprocess.popen(    [        "fswebcam", "-r", "356x292", "-d", "/dev/video0",         "static.jpg", "--skip", "10"    ],     stdout=devnull, stderr=devnull) captureimage.communicate() 

i following error message:

nameerror: name 'subprocess' not defined 

what should do? thanks

have imported first?

import subprocess captureimage = subprocess.popen(["fswebcam", ...) 

subprocess included in python standard library since python 2.4. should not necessary install it.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -