how can i use a pseudoterminal in python to emulate a serial port?,time.sleep(3)