AICon 上海站|日程100%上线,解锁Al未来! 了解详情
写点什么

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:521200
用户头像

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

关注

评论

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

点通生活系统软件开发搭建

10万QPS,K6、Gatling和FunTester对比测试

FunTester

性能测试 接口测试 测试框架 压力测试 测试开发

台达DOP-100系列触摸屏(LUA程序编写用户管理应用)

林建

lua 台达 触摸屏 用户管理 DOP-100

详解 nebula 2.0 性能测试和 nebula-importer 数据导入调优

NebulaGraph

数据库 开源 图数据库

理解Linux 终端、终端模拟器和伪终端

mazhen

Linux Shell SSH Linux Kenel

程序员的自我修养-用科学的方法提高交付质量

刘绍

程序员 软件工程 软件质量 TDD 单元测试

阿里P7亲自讲解!Android大厂面试真题解析大全

欢喜学安卓

android 程序员 面试 移动开发

全美第四大无线运营商 DISH 和亚马逊云科技开展战略合作

亚马逊云科技 (Amazon Web Services)

亚马逊云科技和 Verizon 利用专有 MEC 解决方案扩大 5G 合作

亚马逊云科技 (Amazon Web Services)

架构实战营模块8作业

eoeoeo

架构实战营

从装大象中我们学会了什么设计模式

skow

Java 面试 后端 设计模式

【LeetCode】 H 指数 IIJava题解

Albert

算法 LeetCode 7月日更

玩转Spring Boot Actuator集成,基操,勿六

白亦杨

Java

FIL币最新价格怎么样?FIL币最新消息是什么?

阿里P7大牛手把手教你!卧薪尝胆70天内推入职阿里

欢喜学安卓

android 程序员 面试 移动开发

阿里新出炉爆款的顶配版Spring Security笔记,肝完变秃也变强

Java spring 编程 架构

闭关三月!啃透美团保姆级分布式进阶技术手册,终入美团定L8

Java 面试

经过一年的不懈努力社招进了阿里,我总结了50个Java面试必考题

Java 程序员 架构 面试

铂金10:能工巧匠-ThreadLocal如何为线程打造私有数据空间

MetaThoughts

Java 后端 多线程 并发

Eureka可用性解读

赵镇

Eureka

工商银行:应用多k8s集群管理及容灾实践

华为云开发者联盟

容器 多云 工商银行 k8s集群 Karmada

高并发应对策略系列文章阶段汇总,提供离线文档下载

Coder的技术之路

鸿蒙轻内核源码分析:掌握信号量使用差异

华为云开发者联盟

鸿蒙 数据结构 信号量 结构体 OpenHarmony

阿里P9看了都说牛B!阿里巴巴史上最牛的分布式核心原理深度解析全彩手册

Java架构追梦

Java 阿里巴巴 架构 面试 分布式核心原理解析

发布60分钟!霸榜Github的阿里面试参考指南,啃透涨薪10k

Java架构师迁哥

一文读懂大数据实时计算

五分钟学大数据

实时计算 7月日更

从零开始学习3D可视化之摄像机投影方式

ThingJS数字孪生引擎

大前端 可视化 3D 数字孪生

英特尔中国研究院宋继强:AI技术已成为推动数字化转型的超级力量|WAIC 2021

E科讯

夏令营|第五届埃文网络安全技能训练营火热报名中

郑州埃文科技

直击技术最前沿 | Amazon S3增加新的存档访问层

亚马逊云科技 (Amazon Web Services)

Mtail导致Nginx报警延迟

BUG侦探

运维 监控 日志

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