写点什么

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

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

关注

评论

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

828助力中小企业数字转型有招!华为云Flexus X实例以降本三成定义企业管理

轶天下事

数字转型必答题!华为云新一代云计算产品亮相828

YG科技

chatglm2-6b在P40上做LORA微调

京东科技开发者

最后一公里!观测云如何重塑北欧城市交通

观测云

智能监控

开个技术外挂|用自动建模工具巧妙解决电子产品连续跌落被摔的损伤,再也不怕手滑了

Altair RapidMiner

电子产品 仿真 智能制造 altair

GEP全球供应链波动指数显示,7月份原材料和半成品需求减弱,下降速度达到今年以来最快,表明经济增长放缓

财见

微店商品详情API接口(标题|主图|SKU|价格)获取指南

tbapi

微店商品详情数据接口 微店商品详情API接口 微店API 微店商品列表数据接口

淘宝商品描述API返回值中的HTML格式内容解析技巧

技术冰糖葫芦

API Explorer api 货币化 API 接口 API 测试

玩转生产环境全链路压测

数新网络官方账号

生产环境全链路压测

NFTScan 正式上线 AI Search 浏览器!

NFT Research

NFT

【原创】【深入浅出系列】之代码可读性

京东科技开发者

828企业节来袭!精选华为云Flexus X实例云服务器助力中小企业数字转型之路

轶天下事

旗舰级云服务器首次亮相828,华为云Flexus X实例创新优选精品云服务

轶天下事

直播预约丨《指标体系建设实战》第五期:指标体系构建方法与案例分享

袋鼠云数栈

大数据 数据指标

java浅拷贝BeanUtils.copyProperties引发的RPC异常

京东科技开发者

MES系统怎么解决企业车间生产管理难题

万界星空科技

工业互联网 制造业 生产管理系统 mes 万界星空科技

飞轮科技首席执行官马如悦受邀出席可信数据库发展大会,三大事件,一文解读!

SelectDB

数据库 数据仓库 云原生 实时数仓 大数据 开源

828怎么过?华为云Flexus X实例带你畅享云服务优选之旅

轶天下事

沙利文报告:普渡位居全球商用服务机器人市场份额第一

财见

企业管理上云步伐加快!828亮相的华为云Flexus X实例值得首选

YG科技

数字化转型大势所趋,华为云Flexus X实例云服务器亮相828企业节

YG科技

chatglm2-6b在P40上做LORA微调

京东科技开发者

火山引擎开发者社区 AI Agent 专题,扣子+边缘智能场景探索与实践

火山引擎边缘云

智能IoT边缘服务 AI 模型编译器 LLM AI Agent

828企业节聚焦数字化转型痛点!华为云Flexus X实例重塑行业云计算

轶天下事

828企业节首选云服务器,华为云Flexus X实例3大亮点助力数字化转型

轶天下事

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