如何检索stdout/stderr.txt文件使用pythonsdk的Azure批处理计算节点中的文件?

2024-04-25 04:08:16 发布

您现在位置:Python中文网/ 问答频道 /正文

批处理的.NET文档包含从池中的节点检索文件的方法:link中相应的类没有任何方法。什么是最好的退货方式stderr.txt文件任务失败时的文件?在


Tags: 文件方法文档txtnet节点stderr方式
1条回答
网友
1楼 · 发布于 2024-04-25 04:08:16

我想您可以通过使用pythonbatch_client来实现这一点,我在这里找到了一个实现:https://github.com/Azure/azure-sdk-for-python/blob/master/doc/batch.rst

# Download task output
with open('task_output.txt', 'w') as file_output:
        output = batch_client.file.get_from_task(
                'python_test_job',
                'python_task_1',
                'stdout.txt'
        )
        for data in output:
                file_output.write(data)

相关问题 更多 >