Subprocess is a module. You need to import it.
Put this as the second line in your file: import subprocess
import subprocess