<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def close(self):
 """Tell the process to exit """

        try:
            self.p.stdin.write(bytes("X\n","utf-8"))
            self.p.stdin.flush()
        except IOError:
            self.report("could not send exit command")
        self.p.wait() # wait until the process is closed
        try:
            os.remove(self.tmpfile) # clean up the temporary file
        except FileNotFoundError:
            pass