写点什么

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

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

关注

评论

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

OSI 七层模型和TCP/IP模型及对应协议(详解)

Five

TCP/IP TCP协议 8月月更

react常见面试题

helloworld1024fd

React

重磅大咖来袭!阿里云生命科学与智能计算峰会精彩内容剧透

阿里云弹性计算

高性能计算 生命科学 AI制药 智能计算

DVWA 通关记录 2 - 命令注入 Command Injection

Todd-Lee

博云入选Gartner中国DevOps代表厂商

BoCloud博云

云计算 容器 DevOps 云原生 云平台

【LeetCode】设计数字容器系统Java题解

Albert

LeetCode 8月月更

松哥手把手教你在 Vue3 中自定义插件

江南一点雨

Java Vue

开源一夏 | 深入理解 Spring Cloud Gateway 的原理

悟空聊架构

开源 Gateway 认证 签约计划第三季

开源一夏 | GO语言框架中如何快速集成日志模块

Masters

开源

转转反爬攻防战

转转技术团队

爬虫

C++引用分析实例与案例刨析及使用场景分析详解

CtrlX

c c++ 后端 程序员进阶 8月月更

1对1视频源码——快速实现短视频功能提升竞争力

开源直播系统源码

软件开发 直播系统源码 一对一视频聊天系统

kafka_2.13-3.2.0.tgz配置安装

Cjpler

签约计划第三季

你认同这个观点吗?大多数企业的数字化都只是为了缓解焦虑

雨果

数字化转型 数字化

10份重磅报告 — 展望中国数字经济未来

阿里技术

研究报告

小程序插件的生态丰富,加速开发建设效率

Speedoooo

小程序 小程序容器 小程序插件

爆款视频怎么做?这里或许有答案!

博文视点Broadview

FinClip | 来了, 2022 年 7 月更新大盘点

FinClip

STM32+MPU6050设计便携式Mini桌面时钟(自动调整时间显示方向)

DS小龙哥

8月月更

一体化在线政务服务平台,小程序容器技术加速建设步伐

Speedoooo

小程序 小程序容器 政务平台

阿里云数据存储生态计划发布,助力伙伴数据创新

云桌派

阿里云

Maven中的scope

六月暴雪飞梨花

maven 开源 技术 8月月更 scope

Geoffrey Hinton:深度学习的下一个大事件

OneFlow

人工智能 神经网络 深度学习

阿里前端智能化技术探索和未来思考

阿里技术

前端 智能化

如何在技术上来保证LED显示屏质量?

Dylan

LED显示屏 led显示屏厂家

“纯C”实现——三子棋小游戏

一介凡夫

c 后端、 #开源 8月月更

react高频面试题总结(一)

helloworld1024fd

React

基于微前端qiankun的多页签缓存方案实践

vivo互联网技术

Vue 前端 微前端 qiankun

C++关于函数参数的分析与函数重载进阶教程

CtrlX

c++ 编程语言 后端 cpp 8月月更

流动性质押挖矿系统开发如何制作?单双币系统开发成熟技术

开发微hkkf5566

外包学生管理系统架构文档

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