add python termEmulator code