Added terminal handle
Python code for terminal