import subprocess def draw (quickdraw,x,y,width,height,RED): quickdraw.stdin.write("color " + RED +"\n") # Convert integers to strings stringX = str(x) stringY = str(y) stringWidth = str(width) stringHeight = str(height) quickdraw.stdin.write("rect" + " " + stringX + " " + stringY + " " + stringWidth + " " + stringHeight) quickdraw.stdin.write("\n") def main (): RED = "255 0 0" quickdraw = subprocess.Popen(['java', '-jar', './quickdraw.zip'], stdin = subprocess.PIPE) print "This program will draw a rectangle based on the information that you provide" x = input ("Enter the x coordinate: ") y = input ("Enter the y coordinate: ") width = input ("Enter the width: ") height = input ("Enter the height: ") draw (quickdraw,x,y,width,height,RED) main ()