def send_command(self, cmd):
		if self.proc is None or self.proc.returncode is not None:
			# Process has not started/has terminated
			self.start()

		print('Send command', cmd)
		self.proc.stdin.write(cmd+"\n")
		self.proc.stdin.flush()
		json_res = self.proc.stdout.readline().strip()
		print('Got response', json_res)

		try:
			res = json.loads(json_res)
		except __HOLE__, e:
			res = {
				"success": False,
				"output": json_res
			}

		return res
dataset/ETHPy150Open emersion/bups/bups/sudo.py/Worker.send_command