#To define a particular parameter, replace the 'parameterName' inside itsm.getParameter('parameterName') with that parameter's name
import os
import re
import ctypes
import time
import subprocess
from subprocess import PIPE, Popen
import sys


def alert(arg): 
   sys.stderr.write("%d%d%d" % (arg, arg, arg))


obj = subprocess.Popen('wmic printjob get', shell = True, stdout = PIPE, stderr = PIPE)
out, err = obj.communicate()
if err:
    print err
    alert(0)
elif out:
    print out
    alert(1)