How to fix BrokenPipeError: [Errno 32] Broken pipe in Python | DevErrors