Last active
September 8, 2022 08:56
-
-
Save wfng92/86d6f292aae395a66f605fb1bc181365 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_filepath(filename, extension): | |
return f'{filename}{extension}' | |
def run(): | |
with grpc.insecure_channel('localhost:50051') as channel: | |
... | |
filename = 'test' | |
extension = '.jpg' | |
filepath = get_filepath(filename, extension) | |
for entry_response in stub.DownloadFile(hello_pb2.MetaData(filename=filename, extension=extension)): | |
with open(filepath, mode="ab") as f: | |
f.write(entry_response.chunk_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment