2天时间,聊今年最热的 Agent、上下文工程、AI 产品创新等话题。2025 年最后一场~ 了解详情
写点什么

Windows Azure 已经使用 Python 包装

  • 2008-11-16
  • 本文字数:1518 字

    阅读完需:约 5 分钟

微软项目经理 Sriram Krishnan 已经为 Windows Azure 数据存储编写了一个 Python 包装。Python 是 Windows Azure 支持的语言之一。

根据微软的 Azure 网站,Python 是 Windows Azure 所支持的工具和语言之一:

Windows Azure 是一个开放的平台,将同时支持微软和非微软的语言和环境。Windows Azure 欢迎第三方的工具和语言,例如 Eclipse,Ruby,PHP 和Python…… 世界各地有数百万的开发人员使用.NET Framework 和 Visual Studio 开发环境。开发者可以用相同的技能使用 Visual Studio 创建云化的应用程序,直接使用 Visual Studio 编写,测试和部署。在不久的将来开发人员能够部署用 RubyOn Rails 和Python编写的应用程序。

Sriram 已经用 Python 编写了一个 Windows Azure 的数据存储包装并放在 GitHub 的代码库上。下面的例子演示了存储和查询数据:

复制代码
conn = WAStorageConnection(DEVSTORE_HOST, DEVSTORE_ACCOUNT, DEVSTORE_SECRET_KEY) <br></br>    for (container_name,etag, last_modified ) in  conn.list_containers(): <br></br>        print container_name <br></br>        print etag <br></br>        print last_modified <br></br>    conn.create_container("testcontainer", False) <br></br>    conn.put_blob("testcontainer","test","Hello World!" ) <br></br>    print conn.get_blob("testcontainer", "test")

下面的例子演示登录:

复制代码
def _get_auth_header(self, http_method, path, data, headers): <br></br>   # As documented at http://msdn.microsoft.com/en-us/library/dd179428.aspx <br></br>   string_to_sign =""
<p>#First element is the method <br></br>   string_to_sign += http_method + NEW_LINE</p>
<p>   #Second is the optional content MD5 <br></br>   string_to_sign += NEW_LINE</p>
<p>   #content type - this should have been initialized atleast to a blank value <br></br>   if headers.has_key("content-type"): <br></br>    string_to_sign += headers["content-type"] <br></br>   string_to_sign += NEW_LINE</p>
<p>   # date - we don't need to add header here since the special date storage header <br></br>   # always exists in our implementation <br></br>   string_to_sign += NEW_LINE</p>
<p>   # Construct canonicalized storage headers. <br></br>   # TODO: Note that this doesn't implement parts of the spec - <br></br>   # combining header fields with same name, <br></br>   # unfolding long lines and trimming white spaces around the colon <br></br>   ms_headers =[header_key for header_key in headers.keys() <br></br>   if header_key.startswith(PREFIX_STORAGE_HEADER)] <br></br>   ms_headers.sort() <br></br>   for header_key in ms_headers: <br></br>    string_to_sign += "%s:%s%s" % (header_key, headers[header_key], NEW_LINE)</p>
   # Add canonicalized resource <br></br>   string_to_sign += "/" + self.account_name + path <br></br>   utf8_string_to_sign = unicode(string_to_sign).encode("utf-8") <br></br>   hmac_digest = hmac.new(self.secret_key, <br></br>    utf8_string_to_sign, <br></br>    hashlib.sha256).digest() <br></br>   return base64.encodestring(hmac_digest).strip()

微软的 Windows Azure 计划看起来像是要超越 Google 所提供的。Google 的 App Engine 目前只支持 Python,但是 Google 在将来有支持多语言的计划

查看英文原文: Python Has Wrapped Itself Around Windows Azure

2008-11-16 19:521432
用户头像

发布了 45 篇内容, 共 93540 次阅读, 收获喜欢 1 次。

关注

评论

发布
暂无评论
发现更多内容

前端AST详解,手写babel插件

不叫猫先生

6 月 优质更文活动

vue2.x与vue3.x中自定义指令详解

不叫猫先生

Vue 自定义指令

立即报名 | Microservices June 微服务之月再度开启

NGINX开源社区

nginx 微服务

旺链科技赋能泳池卫士守护人身安全

旺链科技

区块链 泳池安全 泳池卫士

中企出海困难重重?海外税务数字化解决方案来支招!

用友BIP

中企出海

选择优质的led透明屏的7个步骤

Dylan

产品、 LED显示屏 售后服务

GaussDB(DWS)查询过滤器原理与应用

华为云开发者联盟

数据库 华为云 华为云开发者联盟 企业号 6 月 PK 榜

一份配置轻松搞定表单渲染,配置式表单渲染器在袋鼠云的实现思路与实践

袋鼠云数栈

大数据 企业号 6 月 PK 榜

直播预告 | 一体化智能可观测平台如何保障电商节大促

博睿数据

可观测性 智能运维 博睿数据 电商节

漫画告诉你什么是生成式 AI(二)

FN0

AIGC

跨平台开发工具 kbone 实操经验分享

Onegun

小程序 跨平台 前端框架 kbone

深度学习应用篇-计算机视觉-图像分类[2]:LeNet、AlexNet、VGG、GoogleNet、DarkNet模型结构、实现、模型特点详细介绍

汀丶人工智能

人工智能 深度学习 计算机视觉 图像分类 6 月 优质更文活动

大学共享电单车合作投放准备工作

共享电单车厂家

共享电动车厂家 共享电单车投放 共享电动车合作 校内共享电动车

测试左移右移,到底是什么?

老张

测试右移 测试左移

【Netty】「NIO」(二)阻塞模式与非阻塞模式

sidiot

Java 后端 Netty 6 月 优质更文活动

亚信科技AntDB数据库荣获赛宝优选信创优秀解决方案奖

亚信AntDB数据库

AntDB AntDB数据库 企业号 6 月 PK 榜

漫画告诉你什么是生成式AI(一)

FN0

AIGC

【Netty】「NIO」(三)剖析 Selector

sidiot

Java 后端 Netty 6 月 优质更文活动

vue2.x,vue3.x使用provide/inject注入区别

不叫猫先生

Vue 6 月 优质更文活动

Vue3项目中Pinia状态管理工具的使用

不叫猫先生

Vue Pinia 6 月 优质更文活动

顶象发布《车企App安全研究白皮书》,剖析车企App两大风险

说山水

【JavaScript】手写Promise

不叫猫先生

JavaScript Promise 6 月 优质更文活动

Vue项目中实现ElementUI按需引入

不叫猫先生

Vue Element UI 按需加载 6 月 优质更文活动

【云原生】Docker的基本使用方法与优势

不叫猫先生

Docker 6 月 优质更文活动

前端内存泄漏详解

不叫猫先生

内存泄露 6 月 优质更文活动

数字经济快速发展下企业需要什么样的数智平台?

用友BIP

企业数智化 数智平台

人工智能创新挑战赛:海洋气象预测Baseline[4]完整版(TensorFlow、torch版本)含数据转化、模型构建、MLP、TCNN+RNN、LSTM模型训练以及预测

汀丶人工智能

人工智能 数据挖掘 深度学习 LSTM 6 月 优质更文活动

中企出海,数智人力重构企智人效的人才供应体系

用友BIP

人力资源 中企出海 数智人力

聚焦数智人力,让员工“跳槽”不再尴尬!

用友BIP

人力资源 数智人力

苹果WWDC 2023发布会总结

楚少AI

wwdc WWDC 2023 苹果wwdc2023

阿里云丁宇:云上开发成为主流,Serverless 定义新范式

阿里巴巴云原生

阿里云 Serverless 云原生

Windows Azure已经使用Python包装_.NET_Abel Avram_InfoQ精选文章