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

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

关注

评论

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

nginx学习总结

@下一站

nginx 程序设计 11月日更 web 容器 11月月更

2022-12-06:定义一个概念叫“变序最大和“ “变序最大和“是说一个数组中,每个值都可以减小或者不变, 在必须把整体变成严格升序的情况下,得到的最大累加和 比如,[1,100,7]变成[1,6,

福大大架构师每日一题

算法 rust 福大大

极客时间架构实战营第10期模块1作业

刘博

架构

模块一作业

许你丶

#架构实战营

华为云CDN多场景加速,“火速”留住用户

秃头也爱科技

SQLMAP _DNS注入配置方法

网络安全学海

网络安全 安全 信息安全 渗透测试 漏洞挖掘

极客时间运维进阶训练营第六周作业

忙着长大#

极客时间

拒绝等待,华为云CDN下载加速就是要快人一步

路过的憨憨

架构实战营模块7作业

冷夫冲

架构设计 #架构实战营

【es】elasticsearch/es搜索服务器介绍

No8g攻城狮

elastic ES Elastic Search #java

敏捷转型下测试团队该如何安放?

QE_LAB

测试 敏捷转型

ELK-logstash使用总结

忙着长大#

ELK

架构实战营第 10 期:模块一作业

kaizen

「架构实战营」

职场沟通术语

J.Smile

沟通技巧

小游戏与h5游戏开发技术分析

Onegun

小游戏 小程序游戏 H5小游戏

第一周作业

不爱学习的程序猿

小游戏开发游戏引擎指南

Onegun

小游戏 小游戏开发 小程序游戏

低成本、高效率!华为云桌面助力企业数字化转型

IT科技苏辞

前端食堂技术周刊第 62 期:11 月登陆浏览器的新特性、VueConf 2022、第 93 次 TC39 会议、TS 挑战

童欧巴

CSS JavaScript

初步了解Istio

穿过生命散发芬芳

istio 12月月更

盘点JDK中基于CAS实现的原子类

JAVA旭阳

Java Java并发

cleanmymac有用吗?2023最新版本值不值得下载

茶色酒

CleanMyMac CleanMyMac X CleanMyMac X2023

与Web3支付赛道主要项目相比,Zebec生态潜力相当大

BlockChain先知

架构实战营10期-作业1

炮仗

架构实战营第十期模块一作业

Geek_4db2d5

华为云大数据解决方案赋能金融行业发展,打造5G智慧银行营业厅

路过的憨憨

流畅高清,华为云桌面Workspace助力设计师高效办公!

秃头也爱科技

非常好用的Mac系统清理工具CleanMyMac X2023版本

茶色酒

CleanMyMacX CleanMyMac X CleanMyMac X2023

Linux apt 命令

芯动大师

linux 文件权限控制

华为云大数据BI赋能企业数字化发展

秃头也爱科技

模块一作业

飞天的卢

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