原文:issue 70 of Python Weekly


文章,教程和讲座(Articles, Tutorials and Talks)

使用Python Hacking超级马里奥(Hacking Super Mario Bros. With Python)

This post shows how you can use matplotlib's animation tool to create animated gifs based on Super Mario Bros in Python.


实现一个Python OAuth 2.0 提供方 - 第2部分 - 授权服务提供方(Implementing a Python OAuth 2.0 Provider - Part2 - Authorization Provider)

Last week, the first part covered the Basics of the OAuth 2.0 Authorization Flow. This second part will walk through how we used pyoauth2 to set up a minimal Authorization Provider for SHIFT. This post covers setting up endpoints for steps 2 and 5 from the overview.

上周,第一部分阐述了OAuth 2.0授权的基本流程。 该第二部分将大致讲述怎样使用pyoauth2为SHIFT公司建立一个最基本的授权提供方。该文概述授权流程从第2步到第5步端到端的具体实现。

优化你的App Engine应用(Optimizing Your App Engine App)

In this presentation, Johan Euphrosine, Google Developer Program Engineer, shows Datastore pattern and Anti-pattern and how to optimize your App Engine App with Appstats.

该演讲稿中,谷歌开发者计划工程师,Johan Euphrosine,解释了数据存储模式与反模式,以及怎样使用Appstats优化App Engine应用。

使用Rmagic来弥补Python统计分析工具包的缺失(Filling in Python's gaps in statistics packages with Rmagic)

Rmagic is a package which allows you to run R code within the IPython interface. This post explains how it works.


使用Filepicker和Twilio实现通过短信息服务发送图片(Sending Images via SMS with Filepicker and Twilio) provides APIs to connect, process, and store any piece of content in your web application. For example if you are building an application that needs to send files or photos to your users via SMS, then you can use with Twilio to make this happen. Let's explore how to build this.


Versi教程(Versi Tutorial)

Versi is a clone of the Reversi game. The goal of the game is to capture more tiles than your enemy. You can capture the enemy's tiles by placing a new piece on the blank tile so that one or more of enemy pieces are enclosed on a line between your placed piece and one of your existing pieces.


使用Pandas与Matplotlib进行蒙特卡洛法Web服务器统计分析(Monte Carlo Web-Server Statistics using Pandas and Matplotlib)

The author collected the web-server statistic-data by connecting to random web servers and asking it for its name. He was able to maintain 80'0000 concurrent connections on linux using tornados ioloop when he hit the limit of the upstream-bandwidth at home.


使用Django,Node.js以及Socket.IO等实现实时应用(Realtime Django Using Node.js and Socket.IO)

The goal of this post is to show you how to build a realtime chatroom using Django, Redis, and Socket.IO. At a high level this post will show you how you can convert your REST based app into a realtime web app.

该文的目的是阐述如何使用Django, Redis, 以及Socket.IO构建一个实时网络聊天室。从较高层面来看,该文将阐述如何将基于REST的应用转变为实时web应用。

科学家们在使用哪个版本的Python解释器以及相关的库?(What Python Installations Are Scientists Using?)

This post gives you an overview of the results of a survey conducted to find out what Python, Numpy, and Scipy versions the Scientists are using.


Python与Django Web开发(Web Development with Python and Django)

Slides from CodeMash 2013 Precompiler session, "Web Development with Python and Django", including a breezy introduction to the Python programming language and the Django web framework. The example code repository is available here.

来自CodeMash 2013预编译器会议的幻灯片,“Python与Django Web开发”,生动地介绍了Python程序设计语言和Django Web框架。示例代码库见这里

可替代Bash实用脚本的Python脚本(Python Scripts as a Replacement for Bash Utility Scripts)

Instead of replacing a series of bash commands with one Python script, it often is better to have Python do only the heavy lifting in the middle. This allows for more modular and reusable scripts, while also tapping into the power of all that Python offers. Using stdin as a file object allows Python to read input, which is piped to it from other commands, and writing to stdout allows it to continue passing the information through the piping system. Combining information like this can make for some very powerful programs.


pytest入门(pytest introduction)

A post giving you an overview of pytest, a simple example, then throw pytest at my project. It also cover fixtures, test discovery, and running unittests with pytest.


PyHacking攻略(PyHacking step by step)

增强Python Shell以更快速地构建应用,同时减少重复工作(Beefing up the Python Shell to build apps faster and DRYer)

Salt Stack起步---另一个Python实现的配置管理系统(Getting Started with Salt Stack-the Other Configuration Management System Built with Python)

使用Python管理Apple iCloud笔记(Managing Apple iCloud Notes with Python)

如何使用Python实现一个可撤销可重做的Maya命令(How to implement an undoable and redoable Maya command in Python)

Python-使用concurrent.futures并行化计算密集型任务(Python - paralellizing CPU-bound tasks with concurrent.futures)

有趣的项目,工具和库(Interesting Projects, Tools and Libraries)


Are you a hack programmer? Do you find yourself constantly Googling for how to do basic programming tasks? Howdoi gives quick answers to many proragmming questions via the command line.


Baboon Project

Do you waste your time in resolving merge conflicts with your favorite source code manager? Do you want to get rid of "Merge Hell"? Baboon is the solution for you! It's a lightweight daemon that detects merge conflicts before they actually happen. In fact, it detects them in real time.



ToPy solves the problem to obtain a 2D(or 3D, depending on the input file) solid-void (black and white) solution. The result is (a) an optimally stiff structure for minimum compliance problems, (b) an optimal distribution of two materials for heat conduction problems and (c) an optimal distribution of material for efficient mobility.


Simple AI

This lib implements many of the artificial intelligence algorithms described on the book "Artificial Intelligence, a Modern Approach", from Stuart Russel and Peter Norvig. We strongly recommend you to read the book, or at least the introductory chapters and the ones related to the components you want to use, because we won't explain the algorithms here.

这个代码库实现了许多Stuart Russel和Peter Norvig所著“人工智能---一种现代方法”一书中描述的人工智能算法。我们强烈推荐你阅读这本书,或者至少是入门的章节以及与你想要使用的部分相关的章节,因为我们不会解释这些算法。


Radon is a tool for Python that computes various metrics from the source code.



Python module to rename media collections based on scrapes from CLI and GUI tools.



pyelasticsearch is a clean, future-proof, high-scale API to elasticsearch.

pyelasticsearch为elasticsearch(译注:一种开源的分布式搜索引擎,官网见 )提供一个干净的、经得起时间考验的、高可扩展的API。


A python module that lets you import a module or pip install it if it isn't found.



A simple command-line utility (and Python module) to determine your current location.



ArcGIS Python脚本编程(Python Scripting for ArcGIS)

Python Scripting for ArcGIS is a guide to help experienced users of ArcGIS for Desktop get started with Python scripting. This book teaches how to write Python code that works with spatial data to automate geoprocessing tasks in ArcGIS. Readers can thus learn the skill set needed to create custom tools.

ArcGIS Python脚本编程是一本帮助有经验的ArchGIS桌面用户入门Python脚本编程的指南。该书讲解了如何编写Python代码处理空间数据以自动化ArcGIS中的地理数据处理任务。因此,读者能够学习到一些用于创建定制化工具的技巧。

即将来临的大事和在线研讨会(Upcoming Events and Webinars)

马萨诸塞州,剑桥-2013年1月-波士顿Python会议(Boston Python Meetup January 2013 - Cambridge, MA)

There will be following two presentations

  • Zipline - A new, BSD-licensed quantitative trading system which allows easy backtesting of investment algorithms on historical data.
  • Hython - A lisp variant that's fully hosted on and fully interoperable (in both directions) with Python.


  • Zipline - 一个新的、基于BSD许可协议的量化交易系统,允许轻松地对历史数据进行投资算法的事后检验。
  • Hython - 一个完全模仿Python语法并完全可与Python互操作(双向的)的lisp变种语言。(译注:是这个hython么?)

纽约州,纽约-2013年1月-Django-NYC会议(Django-NYC Meetup January 2013 - New York, NY)

This month we'll be taking a look at security. Our guide will be Levi Gross from Matasano. Most of the times security talks are boring. They speak about abstract topics like SQL injection and Cross Site Scripting however, rarely do they show you these bugs in the wild (due to the legal concerns). In this talk we will take a practical look at Django's security features and limitations.

本月我们将讨论安全问题。我们的指导者为来自Matasano的Levi Gross。多数时候,关于安全的演讲总是很枯燥。他们谈论SQL注入和跨网站脚本攻击一类的抽象话题,却很少向你展示在真实环境下的这些bug(考虑到法律问题)。本次演讲中我们将从实际出发看看Django的安全特性与限制。