1

I'd like to filter the content print to sys.stdout. Specifically, I'd like to replace crlf with lf. I don't want to call external program. Is there a way to do so within python?

from apiclient.http import MediaIoBaseDownload
downloader = MediaIoBaseDownload(sys.stdout, request)
user1424739
  • 11,937
  • 17
  • 63
  • 152

1 Answers1

0

So, you are providing a file-like object for the class to write data.

You could use a child class that behaves the way you want OR let it write to a file and then process it OR use a virtual file

Related: How to do virtual file processing?

AMS
  • 244
  • 6
  • 21