写点什么

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

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

关注

评论

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

linux系统管理与自动化运维工具用哪款好?

行云管家

Linux 运维 IT运维 自动化运维

从四种时序数据库选型中脱颖而出,TDengine在工控领域边缘侧的应用

TDengine

数据库 大数据 tdengine 物联网

中山市政务服务数据管理局党组书记叶永忠:积极构筑智慧联接新底座,打造中型智慧城市标杆

InfoQ_967a83c6d0d7

使用 Simple Replay 实用程序简化 Amazon Redshift RA3 迁移评估

亚马逊云科技 (Amazon Web Services)

mad

在Spark Scala/Java应用中调用Python脚本,会么?

华为云开发者联盟

Python spark python脚本 Spark Scala Java应用

开源demo| 智慧协同demo升级——协同更直观方便

anyRTC开发者

音视频 白板 智慧协同 开源demo 远程协助

openGauss 助力邮储银行分布式新核心迈向智能运维时代

恒源云(GPUSHARE)_语音识别与语义处理领域之低资源机器翻译综述

恒源云

机器翻译 语音识别

在线常用crontab表达式大全验证解析

入门小站

工具

MySQL高级特性篇教程

编程江湖

MySQL

低代码实现探索(十五)安全检查报告提高低代码数据安全性

零道云-混合式低代码平台

为什么零售业需要借助CRM系统蓬勃发展

低代码小观

企业管理 CRM 企业管理系统 CRM系统 企业管理软件

workflow 之 Prefect 基本用法(qbit)

qbit

工作流 pipeline workflow 数据流

Linux之df命令

入门小站

Linux

工具 | 如何对 MySQL 进行 TPC-C 测试?

RadonDB

MySQL RadonDB

skywalking核心概念

淡泊明志、宁静致远

3个重点,20个函数分析,浅析FFmpeg转码过程

奔着腾讯去

音视频 WebRTC ffmpeg RTMP RTSP

低代码实现探索(十四)工程化思想提高项目质量与可维护性

零道云-混合式低代码平台

助力产教融合,夯实数据库产业人才基座!openGauss社区分委会正式成立

Mysql索引

zdd

MySQL

前端开发之动态管理Nginx集群的方法

@零度

nginx 前端开发

基于实例数据详解准确率和召回率

华为云开发者联盟

数据集 AUC 信息检索 准确率 召回率

使用Amazon Redshift Simple Replay实用程序简化Amazon Redshift RA3迁移评估

亚马逊云科技 (Amazon Web Services)

mad

风口上的“低代码”,是时候来系统学一学了!

博文视点Broadview

斯图飞腾数据分析平台Stratifyd获评“2021大数据产业创新服务产品”

InfoQ_967a83c6d0d7

面试官惊叹,好小子!你这多线程基础可以啊!

XiaoLin_Java

1月月更

万字详解 Spark 数据倾斜及解决方案

五分钟学大数据

spark 1月月更

效果提升28个点!基于领域预训练和对比学习SimCSE的语义检索

百度大脑

人工智能

【量化】量化交易入门系列6:量化交易学习书籍推荐(二)

恒生LIGHT云社区

量化策略 量化投资 量化交易 量化

Linux云计算好学吗?Linux云计算运维学习资料 vim编辑器和恢复ext4下误删文件

学神来啦

openGauss数据库源码解析系列文章——存储引擎源码解析(五)

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