我正在尝试使用python script
从我的网络应用中运行java
(该脚本位于我的应用文件系统中\ wwwroot目录中的目录上),该脚本使用{{1} }(binary file
),二进制文件大小很大(g.bin
),所以我将它存储在存储帐户(文件服务)中,现在我想使用bin文件中的数据,如何我可以使用我的脚本打开文件吗? 3.5+ GB
应该使用的路径是什么以及如何打开它?
答案 0 :(得分:1)
你需要使用azure-storage python SDK,你需要的模块是azure.storage.file.fileservice
首先初始化FileService
f = FileService(account_name=None, account_
key=None, sas_token=None,
protocol=’https’, endpoint_
suffix=’core.windows.net’,
request_session=None, connection_
string=None)
然后,您需要使用fileservice.get_file_to_stream
方法将文件下载到流中。
f.get_file_to_stream(share_name, directory_name, file_name, stream, start_range=None, end_range=None, validate_content=False, progress_callback=None, max_connections=2, timeout=None, snapshot=None)
试一试。如果您无法使用它,请使用您尝试的内容更新您的问题,我们将很乐意为您提供帮助。