蠎加载 74

原文: Import Python Weekly Newsletter - Issue No 74 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 程序猿 2016年调查: 结果 community 我们想知道当今 Python 程序猿的真实生存状态, 在调查了 1000+ Python 程序猿后,得到一些有趣的结论, 在此分享大家; (是也乎: 简单的说:独自折腾的少,作为主语言和 JS 总是基在一起, 今年 Py 2 和 3 将战平, 框架中的 IPython/Falsk/numpy等科学计算框架, 在高速追上 Django; Debug 工具依然没有性能评估工具来的认同多,,,, 嗯哼,当然调查是 JETBRAINS 发起的… ) GitHub - SykoTheKiD/DockerDjangoRest: 有Travis CI 支持的 Django REST 接口 Docker镜像 docker A Docker setup for a Django REST API with Travis CI support. Includes Python 2.X and Python 3.X, PostgreSQL, Unicorn ,Nginx, Travis CI Integration. 如何在 Ubuntu 16.04 上用 uWSGI+NGINX 发布 Django 应用服务? | DigitalOcean django In this guide, we will demonstrate how to install and configure some components on Ubuntu 16.04 to support and serve Django applications. We will configure the uWSGI application container server to interface with our applications. We will then set up Nginx to reverse proxy to uWSGI, giving us access to its security and performance features to serve our apps. (是也乎: 所有 VIP 厂商中 DigitalOcean 的文章总是清晰又专注, 而且可以直接使用. ) Django Channels 作为后台任务 django This little tutorial is what you need to add a background task processor to Django using channels. Our task for this example will just be outputting “Hello, Channels!”, but you could image running a subprocess on some data or sending an email. Python 101: 基准代码简介 benchmark The main idea behind benchmarking or profiling is to figure out how fast your code executes and where the bottlenecks are. The main reason to do this sort of thing is for optimization. You will run into situations where you need your code to run faster because your business needs have changed. When this happens, you will need to figure out what parts of your code are slowing it down. This article will cover how to profile your code. 用 jxmlease 在 XML 和自然 Python 数据结构间转换 core python, xml One of the important realizations we made was that Python objects also have metadata. So, we can represent the XML data as normal Python objects, but store the XML metadata as metadata in the resulting Python objects. Using jxmlease, you can easily convert XML data to Python data structures. Here, the ‘xml’ variable contains the XML document shown in Example 2 (below). You convert it to Python data objects and print it. (是也乎: 嗯哼?! XML,现在还有什么场景一定要 XML 的!? ) Python 插件管理器: Stevedore 和 Pike 如果折腾过 OpenStack, 那么一定不得不折腾插件管理器: stevedore; 现在介绍另一个值得折腾的: pike Python 软件基金会新闻: Brett Cannon 赢得 Frank Willison Award core python This morning at OSCON, O’Reilly Media gave Brett Cannon the Frank Willison Memorial Award. The award recognises Cannon’s contributions to CPython as a core developer and project manager for over a decade. Kel — 用Python 和 Go 构建的基于 Kubernetes 的开源 PaaS Kel™ is an open-source Platform as a Service (PaaS) from Eldarion® that makes it easy to manage web application deployment and hosting through the entire software lifecycle. Kel helps DevOps professionals manage their application infrastructure through a layer of tools and components that make Kubernetes accessible and easier to use. Kel builds on Eldarion’s 7+ years experience running Gondor, one of the leading Python / Django PaaS solutions. 探索美国交通事故数据 data science At a ChiPy event, Nick Bennett gave an excellent talk on traffic fatalities and how he attempts to visualize the publicly available data. The accompanying GitHub repo shows how he accessed and manipulated some of that data with Python tools and then used a couple of different web mapping services to visualize it. The talk prompted some informative comments from the audience and inspired me to further analyze the data myself. bisect — 用 Orderr 保持列表排序 core python The bisect module implements an algorithm for inserting elements into a list while maintaining the list in sorted order. 活动 ~ Upcoming Conference / User Group Meet ...

2016-05-28 · 3 min · 1266 words · ZoomQuiet

蠎加载 73

原文: Import Python Weekly Newsletter - Issue No 73 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 3: 加密介绍 python3, encryption Py 3 并没有增补更多加密相关的库, 本文专注第三方库: PyCrypto 和 cryptography, 展示如何进行加密以及对应的解密. 如何用 Python 为 Slack 构建短信机械人 bot Bots can be a super useful bridge between Slack channels and external applications. Let’s code a simple Slack bot as a Python application that combines the Slack API with the Twilio SMS API so a user can send and receive Slack messages via SMS. 并发修饰器 - Python 并发真的很容易 全新得趣的库 deco, 专门进行并发运行的修饰, 作者是 Alex Sherman 和 Peter Den Hartog, 都在 Wisconsin Madison 大学. Python 包索引的能量 pypi 介绍 PyPI 的真相. The Python Package Index, or as most call it “PyPI” is a central part of the ecosystem of Python. It serves as a central registry of names, helping to prevent collision between different projects as well as the default repository that most Python users go to when looking for software.For most, what powers this service is largely opaque to them — it’s (usually) there when they need it and who or what powers it is largely a mystery to them, but what and who really powers PyPI? 在 AWS 上部署 Django 接口为 Docker 容器 django, docker Docker is a wonderful technology revolutionazing how to run microservices. You may have some experience with it or may not. I will show in this short post how to run a Docker container in Amazon Web Services(EC2) with your whole API in it. This trick is only useful for APIs or django projects that doesn’t need to scale and doesn’t really have too much traffic. 扩展创业项目达到 200万点击/月 - 访谈 railwayapi.com 创始人 Kaustubh PythonAnywhere is a Python development and hosting environment that displays in your web browser and runs on our servers. They’re already set up with everything you need. It’s easy to use, fast, and powerful. There’s even a useful free plan. In this interview Kaustubh talks about his experience of using PythonAnywhere. Facebook 趋势 RSS 抓取 (w/ Python 3.5) 快速构建的 py3 脚本, 处理来者 RSS 的 PDF 列表,监察 facebook 有关突发新闻. Apache Spark 2.0: 结构化数据流介绍 machine learning Michael Armbrust and Tathagata Das explain updates to Spark version 2.0, demonstrating how stream processing is now more accessible with Spark SQL and DataFrame APIs. Video. Code snippets in Python. Python 贴士列表 :: 提升清单 core python Simple code snippets, stuff we need in everyday coding. Worth a quick glance. Pygrunn: 微型 Python, Pythonic 的物联网 - Lars de Ridder core python (嗯哼,为了 RAM 平台,我们不能使用 CPython) micropython is a project that wants to bring python to the world of microprocessors. Micropython is a lean and fast implementation of python 3 for microprocessors. It was funded in 2013 on kickstarter. Originally it only ran on a special “pyboard”, but it has now been ported to various other microprocessors. Why use micropython? Easy to learn, with powerful features. Native bitwise operations. Ideal for rapid prototyping. (You cannot use cpython, mainly due to RAM usage.) 从 Python 直接加载 C++ 文件! Anyone looking to speed up critical regions of their script should have a look. Python ASCII 动画生成器 : 也许有的人需要? Pretty cool decorator. Check out the gif screen-cast. (是也乎: 将CLI 的输出,折腾为 gif 动画片; 嗯哼,不够科学… ) Pygrunn: 理解 PyPy 并在生产中应用之 - Peter Odding/Bart Kroon pypy pypy is “the faster version of python”. There are actually quite a lot of python implementation. cpython is the main one. There are also JIT compilers. Pypy is one of them. It is by far the most mature. PyPy is a python implementation, compliant with 2.7.10 and 3.2.5. And it is fast!. Djangofriendly » Django 主机对比和资源 django Djangofriendly is a community resource for finding the friendliest Django hosting environments. Asterix - 完备的 python 初始化系统 core python Describe the initialization of your application and let asterix manage the startup for you. It will ensure that the correct dependencies are started in order, so you don’t need any dirty hacks to have your initialization flow. Also, it allows you to build separate stacks for test/dev/production and even for web/batch applications, loading just what you need. 新书 ~ New Books ...

2016-05-19 · 3 min · 1354 words · ZoomQuiet

蠎加载 72

原文: Import Python Weekly Newsletter - Issue No 72 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 生成器解析 core python Python has a compact syntax for constructing a list with a loop and a condition, called a list comprehension: my_list = [ f(x) for x in sequence if cond(x) ] . You can also build dictionaries with dictionary comprehensions, and sets with set comprehensions/// Asyncio 和 uvloop benchmark 上周看到了 uvloop 的简介, 号称比 Asyncio 快两倍以上, 不服来测! 嗯哼 基本属实 ;-) Today, I read an article about uvloop. I am aware of libuv and its behind nodejs. What caught me was “In fact, it is at least 2x faster than any other Python asynchronous framework.”. So I decided to give it a try with aiohttp. The test program was simple websocket code which receives a text message, doubles the content and echoes back. Here is the complete snippet with uvloop. I ran naive benchmark using thor and results favoured uvloop. uvloop was able to handle more connection on 8GB , non SSD Mac OSX . Asyncio was able to hold 154 connections and uvloop 243 connections with any socket errors . Python 成本分析脚本 - AWS EC2 vs AWS Lambda - reddit discussion (self.Python) aws 官方号称 Lambda 比 EC2 性价比高… So I decided AWS Lambda had been on the field enough time to make an analysis by my own. Lambda comes with a few problems like only Python 2.7 (they will fix it in the future I guess), libraries, etc. Also I had read some blogs like Flynn’s one. But skipping those problems I wanted to know… What about money ? 用 python, pandas, matplotlib 下载/分析/可视化 10年份 last.fm 音乐收听历史 (代码在 github) machine learning Using Python, pandas, matplotlib, and leaflet, I downloaded my listening history from Last.fm’s API, analyzed and visualized the data, downloaded full artist details from the Musicbrainz API, then geocoded and mapped all the artists I’ve played. All of my code used to do this is available in this GitHub repo, and is easy to re-purpose for exploring your own Last.fm history. All you need is an API key. (是也乎: 以及类似的分析 twitter/facebook/instagram … SNS 海量数据的根源都是: 人家开放了接口! ) 应该学写 Python 装饰器的五大理由 core python Python decorators are so easy to use. Anyone who knows how to write a Python function can learn to use a decorator. But writing decorators is a whole different skill set. And it’s not trivial; you have to understand. closures, how to work with functions as first-class arguments, variable arguments, argument unpacking, even, some details of how Python loads its source code (是也乎: bigger and bigger and bigger and bigger and bigger … ) TPOT: 自动化数据科学平台 赞助商 In this article, we’re going to go over three aspects of machine learning pipeline design that tend to be tedious but nonetheless important. After that, we’re going to step through a demo for a tool that intelligently automates the process of machine learning pipeline design, so we can spend our time working on the more interesting aspects of data science. 如何获得 Python 工作岗位? - Reddit Discussion core python Recently, I’ve been playing around with Python and found that I really enjoy the language. Now I am wondering how I should go about switching over to a Python job. I am tired of doing front-end web development, and am thinking that I would enjoy concentrating more on the back-end. However, the back-end Python jobs seem to require me being a data scientist. Also, it seems like most Python jobs are in QA automation or DevOps. (是也乎: 汇同 哪种语言/编辑最好 为三大月经贴… 其实,很简单…自个儿创造这个岗位! ) Why Python? What’s it good for? How is it special? core python Quick read justifying Python. 安装 Jupyter Notebook Extensions video Jonathan Whitmore demonstrates how to install pivot tables and showcases the features of this extension by examining a dataset of restaurant scores.Pivot tables are one of the many ways to extend the capabilities of the Jupyter Notebook. In this training segment, learn how to quickly and effectively analyze, scope, and visualize data using pivot tables in Jupyter Notebook. (是也乎: 高级特性, 数据透视表的深化折腾… ) davidmiller/pony-mode: Django mode for emacs emacs pony-mode - Django mode for emacs 用 ctypes 来从 Python 调用 C 代码 code snippet This recipe shows basic usage of the ctypes module to call C code from Python code. 给 Django 追加用户验证 django If you are building a new Django website from scratch, the first thing you implement is the User authentication. Here is a simple article showing you how to do it. Django, ELB 健康检查和持续交付 | Octopus Energy Tech blog aws A robust means of deploying web applications with Amazon Web Services is to use an Elastic Load Balancer (ELB) to balance requests between an “Auto Scaling Group” (ASG) of EC2 instances. As well as horizontally scaling, this set-up allows automated canary (aka blue-green) deployments, where new application versions are deployed as a new ASG which replaces the existing EC2 instances with new; a so-called “immutable infrastructure” approach. DjangoPaths - 为毛俺选择 Wagtail? cms 在折腾了 Django-CMS 和 Mezzanin 之后, 还是理智的入了 Wagtail 教. My decision to delve into Wagtail only came after I attempted to use Django-CMS and Mezzanine. Their strengths seemed to lie in having a comprehensive ecosystem in place with pluggable e-commerce systems and more. 部署 Django + Python 3 + PostgreSQL 到 AWS Elastic Beanstalk - Real Python aws The following is a soup to nuts walkthrough of how to set up and deploy a Django application, powered by Python 3, and PostgreSQL to Amazon Web Services (AWS) all while remaining sane.Elastic Beanstalk is a Platform As A Service (PaaS) that streamlines the setup, deployment, and maintenance of your app on Amazon AWS. It’s a managed service, coupling the server (EC2), database (RDS), and your static files (S3). You can quickly deploy and manage your application, which automatically scales as your site grows. Onion IoT 和 Lazar 以及 Zheng podcast IoT 物联网时代来了, OpenWRT 是其中最具成功相的平台. One of the biggest new trends in technology is the Internet of Things and one of the driving forces is the wealth of new sensors and platforms that are being continually introduced. In this episode we spoke with the founder and head engineer of one such platform named Onion. The Omega board is a new hardware platform that runs OpenWRT and lets you configure it using a number of languages, not least of which is Python. 新书 ~ New Books ...

2016-05-13 · 4 min · 1949 words · ZoomQuiet

蠎加载 71

原文: Import Python Weekly Newsletter - Issue No 71 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 元类解释 core python Python 的核心特性就是:一切为对象, 其实都是类的实例. 教程:如何基于 Django,Ngrok 构建 facebook 消息机械人 - Blog - Abhay Kashyap django 2016 是 Facebook 机械人元年, 基于地球上最大的短信平台, Facebook 推出了 Messenger 平台, 支持企业构建自己的自动应答系统; 此平台虽然还在 beta 阶段, 但是接入了 十亿 活跃用户,值得折腾…. uvloop: 异常快的 Python 网络 web framework asyncio 是当前 Python 的标准异步 I/O 网络框架. uvloop 则是能完全替代 asyncio 完备的更快的异步事务循环. 基于 libuv 以 Cython 构建; 事实上 uvloop 比 nodejs, gevent 或是其它异步框架快两倍以上. 性能接近 Go 语言实现的. Django 爱好者的 ES6 django The Django community is not one to fall to bitrot. Django supports every new release of Python at an impressive pace. Active Django websites are commonly updated to new releases quickly and we take pride in providing stable, predictable upgrade paths. We should be as adamant about keeping up that pace with our frontends as we are with all the support Django and Python put into the backend. I think I can make the case that ES6 is both a part of that natural forward pace for us, and help you get started upgrading the frontend half of your projects today. Growler web framework 利用通过 PEP 3156 包含在 Python 3.4 内建模块中的 asyncio 库, Growler 作为 web 应用框架, 类似 nodejs 的 express 库, 基于一系列中间件完成 HTTP 请求响应. 也通过中间件的串接完成复杂业务. (是也乎: 何时开始微型 web 框架都和瓶子干上了!? ) Redis 缓存修饰符 code snippet 用 redis 完成的髙水平的函式缓存. 应该聘请那种给力的 Python 开发者? Reddit Discussion I need some advice. I founded a SAAS startup that is doing pretty well. When I was looking to build out my software I found a developer I had worked with in the past and brought him on as a partner in the business. He held an equity stake and built out the backend of our software (restful API and database) all using Python. Front end is also Python based. Django bugfix 版本发布: 1.9.6 + 1.8.13 release Today we’ve issued bugfix releases for the 1.9 and 1.8 release series. Details can be found in the release notes for 1.9.6 and 1.8.13. Python 3 的功能卫士 code snippet 模块实现了功能卫士 - 根据不同的参数将运行时调用重定向到不同的函式上. 表现形式是 @guard 修饰符. 并提供缺省值表达式: _when 用 Python 来预测你更喜欢面条中加 Qdoba 还是 Chipotle. machine learning I’ve had a theory that for every Noodles, there’s a Qdoba that’s right next door. It might be some sort of selection bias however, since I can think of a couple locations where they’re directly next to each other. To me, Noodles and Qdoba have a special relationship, at least compared to other restaurants. I figured now was about the time I should test this, and I can use Chipotle to test. The question is: Which restaurant is more special to Noodles, Qdoba or Chipotle? 随机找到 bit.ly 地址 code snippet 如果有人有足够的计算能力会发生什么? PYCON上提出了澳大利亚教育研讨会的演讲!! community Involved in Australian education, whether formally or informally? Making use of Python in your classes, workshops or other activities? Interested in sharing your efforts with other Australian educators, and with the developers that create the tools you use? Able to get to the Melbourne Convention & Exhibition Centre on Friday August 12th, 2016? Then please consider submitting a proposal to speak at the Python in Australian Education seminar at PyCon Australia 2016! Get on Track w/ JIRA. Sponsor JIRA Software is the #1 software dev tool used by agile teams. Get started for free! 新书 ~ New Books ...

2016-05-06 · 3 min · 1373 words · ZoomQuiet