蠎加载 85

原文: Import Python Weekly Newsletter - Issue No 85 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Daniel Bader: Sublime Text 为 Python 开发 — 回顾2016 sublime When you ask for editor recommendations as a Python developer one of the top choices you’ll hear about is Sublime Text. In this post I’ll review the status of Python development with Sublime Text as of 2016. (是也乎: subl 从一开始就和 py 纠缠在一起… ) 69集 - PyCon Canada 和 Francis Deslauriers 以及 Peter McCormick podcast This week we interviewed Peter McCormick and Francis Deslauriers about their work organizing PyCon Canada to provide a venue for Canadians to talk about how they are using the language. If you happen to be near Toronto in November then you should get a ticket and help contribute to their success. 1M rows/s 从 Postgres 到 Python benchmark asyncpg is a new fully-featured open-source Python client library for PostgreSQL. It is built specifically for asyncio and Python 3.5 async / await. asyncpg is the fastest driver among common Python, NodeJS and Go implementations. (是也乎: Pg 输出全新的 py 客户端库,包含了最新的 py/node/go 的支持 ) Package of the Week: Flake8 Flake8 is a Python library that wraps PyFlakes, pycodestyle and Ned Batchelder’s McCabe script. It is a great toolkit for checking your code base against coding style (PEP8), programming errors (like “library imported but unused” and “Undefined name”) and to check cyclomatic complexity. (是也乎: 包含圈复杂度检测的代码风格工期 ) Brett Cannon: 网络协议, sans I/O (Hopefully) the future of network protocols in Python. I think it’s important to promote this approach to implementing network protocols, to the point that I have created a page at https://sans-io.readthedocs.io/ to act as a reference of libraries that have followed the approach I’ve outlined here. Basically what this means is that network protocol libraries will need to be rewritten so that they can be used by both synchronous and asynchronous I/O . (是也乎: 为了异步网络, 又一个协议包在冲进! ) 用 django-admin-honeypot 建立蜜罐 django Security is something we often ignore until it is too late. However, there are some things you can do right now that are easy to increase your security. Using django-admin-honeypot is one of those things you can do. It is super easy and provides you with the means of tracking who is trying to access your site. (是也乎: Django 越来越全能了… ) 你应该知道的 Django Admin 作为应用更 Bigger django admin panel The Django admin is a very powerful tool. We use it for day to day operations, browsing data and support. As we grew some of our projects from zero to 100K+ users we started experiencing some of Django’s admin pain points?—?long response times and heavy load on the database. (是也乎: 其实, 很久以前 Django Admin 当现成的 app 来使用就已经不是黑科技了… ) 介绍用 Python 进行自然语言处理 - Asyncjs video In this talk, Jess Bowden introduces the area of NLP (Natural Language Processing) and a basic introduction of its principles. She uses Python and some of its fundamental NLP packages, such as NLTK, to illustrate examples and topics, demonstrating how to get started with processing and analysing Natural Languages. She also looks at what NLP can be used for, a broad overview of the sub-topics, and how to get yourself started with a demo project. (是也乎: 对的, 也是很久之前, Py 就是自然处理的重要参与力量了, 毕竟对于非程序猿的科学家, 用 py 的阻力小很多… ) Simon: datetime vs Arrow vs Pendulum vs Delorean vs udatetime datetime I setup a benchmark, which can be found here to compare Python datetime, Arrow, Pendulum, Delorean and udatetime on a performance level. I picked 4 typical performance critical operations to measure the speed of those libraries. Decode a date-time string, Encode (serialize) a date-time string, Instantiate object with current time in UTC, Instantiate object with current time in local timezone, Instantiate object from timestamp in UTC, Instantiate object from timestamp in local timezone. (是也乎: 嗯哼, 日期处理是又常用又头痛的一件事儿…这么多年过去了, 依然没有什么完美的形式来打动 guido 收入标准库… ) PyPy 获得 Mozilla 的资助用以支持 Python 3.5 community Mozilla recently decided to award $200,000 to Baroque Software to work on PyPy as part of its Mozilla Open Source Support (MOSS) initiative. This money will be used to implement the Python 3.5 features in PyPy. Within the next year, we plan to use the money to pay four core PyPy developers half-time to work on the missing features and on some of the big performance and cpyext issues. (是也乎: 銭虽然不多, 但是可以看出 Mozilla 对 rust 并不放心, 还在继续确保其它可能性 ) 你的 Django 故事: 遇见 Katerina Kampardi djangogirls Katerina Kampardi is a Web Applications Developer from Greece who works as a freelancer. Like many aspiring developers, Katerina is self-taught and got her start with online tutorials. She later attended a Python Specialization. Today, she works on various Django projects as an independent developer. 活动 ~ Upcoming Conference / User Group Meet ...

2016-08-29 · 3 min · 1432 words · ZoomQuiet

蠎加载 86

原文: Import Python Weekly Newsletter - Issue No 86 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 打包现在不错了 Python packaging is not bad any more. If you’re a developer, and you’re trying to create or consume Python libraries, it can be a tractable, even pleasant experience. A historical perspective of how it’s evolved and where it stands today. (是也乎: 嗯哼?!谁说的?! ) Python 3.6.0 alpha 4 预览版释放 new release Python 3.6.0a4 has been released. 3.6.0a4 is the last of four planned alpha pre-releases of Python 3.6, the next major release of Python. During the alpha phase, Python 3.6 remains under heavy development: additional features will be added and existing features may be modified or deleted. Please keep in mind that this is a preview release and its use is not recommended for production environments. Python 3.6.0 is planned to be released by the end of 2016. The first beta pre-release, 3.6.0b1, is planned for 2016-09-12. (是也乎: 嗯哼,今年 PyCon16China 大会口号还有人提议: 就不用 Py3 老爹太囧了… ) 每个人都要的 Python Library core python Do you write programs in Python? You should be using attrs. (是也乎: Limodou 就写过类似模块;-) ) Django 技巧 #11 用 Chainable QuerySets 自定管理器 django In a Django model, the Manager is the interface that interacts with the database. By default the manager is available through the Model.objects property. The default manager every Django model gets out of the box is the django.db.models.Manager. It is very straightforward to extend it and change the default manager. dis — Python 字节码反编译器 — PyMOTW 3 core python The dis module includes functions for working with Python bytecode by “disassembling” it into a more human-readable form. Reviewing the bytecodes being executed by the interpreter is a good way to hand-tune tight loops and perform other kinds of optimizations. It is also useful for finding race conditions in multi-threaded applications, since it can be used to estimate the point in the code where thread control may switch. (是也乎: 推荐用来估计代码中线程可切换点 ) Python 基金会寻求一位 blogger ! community Are you the one ? Andrew Ng 的机器学习练习在 Python machine learning One of the pivotal moments in my professional development this year came when I discovered Coursera. I’d heard of the “MOOC” phenomenon but had not had the time to dive in and take a class. Earlier this year I finally pulled the trigger and signed up for Andrew Ng’s Machine Learning class. I completed the whole thing from start to finish, including all of the programming exercises. The experience opened my eyes to the power of this type of education platform, and I’ve been hooked ever since. Codementor: 如何使用 Python 上下文管理器制作 Sandwich core python Explains Context Manager using “Making a sandwich” as an example. (是也乎: ) Micropython 以及如何在老屏幕上使用 esp8266. embedded systems Wemos D1 mini is a 64x48 oled screen that can be mounted on the d1 really easily. The screen has an I2C interface and driven by a SSD1306 chip which is thankfully supported by micropython. Full details, code snippets, schematics can be found on this article. (是也乎: 又见 I2C … ) pyvideo is back video Brandon Rhodes on Twitter: “Welcome to the new http://pyvideo.org !” Thanks to the original maintainers, the new, & the PSF for this site! 活动 ~ Upcoming Conference / User Group Meet ...

2016-08-29 · 2 min · 945 words · ZoomQuiet

蠎加载 87

原文: Import Python Weekly Newsletter - Issue No 87 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Daniel Bader 为Py开发者的 Youtube 频道 video Useful Youtube channel with short screencast/videos for Python developers to subscribe to. I learned on couple of sublime + Python tricks from here. (是也乎: 细心为 Pythonista 收集整理的油管频道, 包含了 subl+py 的技巧演示… ) dockerfiles/django-uwsgi-nginx: docker This Dockerfile shows you how to build a Docker container with a fairly standard and speedy setup for Django with uWSGI and Nginx. 有趣的 Python 教程 curated list I have read some interesting Python tutorials lately. I would love to share them with you. Kyoukai - 完全异步灵感源自 Flask 的Py3.5+ web 框架 web framework Kyoukai is a fast asynchronous Python server-side web framework. It is built upon asyncio and the Asphalt framework for an extremely fast web server. (是也乎: Kyōkai (境界) 嗯哼,因为日语有完全可发音的罗马形式,所以,总是被选为工程名嘛?! 也使用了 Blueprintslink 进行扩展,基本上就是 flask 的异步简化版本. ) 0停机的升级到 Python 3 with Zero Downtime · YPlan Tech Blog python3 We recently upgraded our 160,000 lines of backend Python code from Python 2 to Python 3. We did with zero downtime and no major errors! Here’s how we did it, hopefully it will help anyone else still stuck on Python 2! (是也乎: 终于有人成功尝试了, 一次性将 16万行 py2 代码升级为 py3 的… 你信嘛?!反正俺相信了. ) BangPypers: 有关自动化的讨论 - 2016 August Meetup automation Bangalore user group meet with Python Automation as the theme (是也乎: 看人家的 meetup 在讨论什么… 看人家的环境比我们也没有高哪儿去哪 ) Mike Driscoll: ANN: The wxPython Cookbook Kickstarter Kickstarter Campaign for wxPython Cookbook. (是也乎: 现在什么都能众筹了哪… ) 和俺说 Python: #72 时尚驱动的开源软件在 Zalando podcast What happens when you take a tech-driven online fashion company that is experiencing explosive growth and infuse it with a deep open-source mission? You’ll find out on this episode of Talk Python To Me. We’ll meet Lauri Apple and Rafael Caricio from Zalando where developers there have published almost 200 open source projects on Github. (是也乎: 可以下载 mp3 的播客, 有关 Fashion-driven 来自 Womens Shoes & Fashion | ZALANDO.CO.UK 团队 关键是这种播客坚持了很长时间…如何?为何?谁在听? 推荐 Machine learning at the new Microsoft 以及专属 rap Developers, Developers, Developers ) 访问控制: 一个 Django 许可的应用比较 django There are many ways to handle permissions in a project. For instance we may have model level permissions, object level permissions, fine grained user permission or role based. Either way we don’t need to be writing any of those from scratch, Django ecosystem has a vast amount of permission handling apps that will help us with the task. In this post we will compare how some popular permission apps work so you know which one suits your project needs. Machinalis: 搜索外星人 image processing Do you know what they are? If you are thinking of irrigation circles, you are wrong. Do not believe the lies of the conspirators. Those are, undoubtedly, proofs of extraterrestrial visitors on earth. As I want to be ready for the first contact I need to know where these guys are working. It should be easy with so many satellite images at hand. So I asked the machine learning experts around here to lend me a hand. Surprisingly, they refused. Mumbling I don’t know what about irrigation circles. Very suspicious. But something else they mentioned is that a better initial approach would be to use some computer-vision detection technique. Note - Code is here https://github.com/machinalis/satimg/blob/master/Searching%20for%20aliens.ipynb (是也乎: 标题党… ) 为何要学习 Python ? community Hopefully this post gave you some insight into why you should consider giving Python a go. This post is coming from someone who feels “guilty” for talking not so good about Python in the past and is now all over the hype train. In my defense, it was just a “personal preference thing”, when people asked me about which language they should learn first, for instance, I usually suggested Python. (是也乎: 嗯哼, 一切鳮汤都抵不上一个确切的职位… ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-08-29 · 3 min · 1193 words · ZoomQuiet

蠎加载 84

原文: Import Python Weekly Newsletter - Issue No 84 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Django 图书全集 books Djangoweekly has a listing of all published Django books on one page. Note check publication date and which version of Django the book is using. 为毛应该用 Python 3? python3 The short answer is: because it’s the actively-developed version of the language, and you should use it for the same reason you’d use 2.7 instead of 2.6. If you’re here, I’m guessing that’s not enough. You need something to sweeten the deal. Well, friend, I have got a whole mess of sugar cubes just for you. (是也乎: 何时没有这种文章发布了, 才说明 Py3 真正获得用户肯定了 ) 和 Josh Gordon 学习机械学习 machine learning, video Series of Python Videos by Josh Gordon of Google teaching Machine learning basics. 流利的 Python: 特殊方法的威能 pythonic Pythonistas praise a good API by calling it “Pythonic.” That quality has much to do with proper use of the special methods used in the Python Data model, which define the essential behaviors that we expect in objects. Perhaps you’ve used Python for years. Do you really know it? This tutorial is intended for a Python programmer who has working/practical knowledge of the language plus an understanding of object-oriented programming, who now needs to learn how to write idiomatic APIs (是也乎: 正确用好内置数据结构是一组稳固 API 的基础. ) 如何构建 Django 信号 django The Django Signals is a strategy to allow decoupled applications to get notified when certain events occur. Let’s say you want to invalidate a cached page everytime a given model instance is updated, but there are several places in your code base that this model can be updated. You can do that using signals, hooking some pieces of code to be executed everytime this specific model’s save method is trigged. In this tutorial I will present you the built-in signals and give you some general advices about the best practices. (是也乎: 嗯哼,将 GUI 的信号/槽 机制用在 web 中. ) Semaphore 社区: 用 Behave 进行 Python 应用行为测试 testing Learn how to write behavioral tests for your next Python application using the Behave library. Django 1.10 发布 django, release Full text search for PostgreSQL. New-style middleware to solve the lack of strict request/response layering of the old-style of middleware. Official support for Unicode usernames. Check release notes for more info. 自动化 OSINT: 暗网 OSINT 使用 Python 和 OnionScan: 第一节 security You may have heard of this awesome tool called OnionScan that is used to scan hidden services in the dark web looking for potential data leaks. Recently the project released some cool visualizations and a high level description of what their scanning results looked like. What they didn’t provide is how to actually go about scanning as much of the dark web as possible, and then how to produce those very cool visualizations that they show. (是也乎: 类似 Zoomeye 服务,从 dark web 中为用户进行数据泄漏检验, 也是数据科学的一种, 所以, 必然的 Python 可以 ) “避免知识的诅咒”: 社区服务奖获得者 Ned Batchelder 曰 community The Python Software Foundation recognized Batchelder with a Community Service Award for his tireless work helping run the Boston Python user group, being a regular speaker at conferences, maintaining coverage.py, and being a friendly face for the community on IRC and elsewhere (是也乎: coverage.py 的创造者 ) Python 201: multiprocessing 教程 multiprocessing The multiprocessing module was added to Python in version 2.6. It was originally defined in PEP 371 by Jesse Noller and Richard Oudkerk. The multiprocessing module allows you to spawn processes in much that same manner than you can spawn threads with the threading module. The idea here is that because you are now spawning processes, you can avoid the Global Interpreter Lock (GIL) and take full advantages of multiple processors on a machine. (是也乎: Py2.6 就加入内置模块了, 但是,用起来的不多 ) Django Channels 和 Celery 样例 - Vincent Zhang django, celery In this tutorial, I will go over how to setup a Django Channels project to work with Celery and have instant notification when task starts and completes. Django Channels uses WebSockets to enable two-way communication between the server and browser client. It is assumed that the reader is comfortable with how to setup a normal Django project and we will only cover the parts relating to Channels and Celery. (是也乎: 华人,当然外国的… ) 用 Keras 和 Python 开始深度学习 deep learning Despite all the recent buzz about deep learning, the design and testing of a neural network pipeline may become a task for developers who aren’t machine learning specialists. This tutorial is intended for a software developer who has intermediate experience in Python, plus some hands-on experience developing data pipelines and working with machine learning use cases, who now needs to learn how to build high-performance classifiers based on deep learning. udatetime 已经支持 PyPy pypy I just finished the performance optimized pure Python implementation of my RFC3339 date-time library udatetime for PyPy and Python 3.5. The benchmark say PyPy is now officially the fastest with udatetime. Again it’s astonishing how good PyPy performs. 连续分析新闻: Dask 和 scikit-learn: 教程三部曲 scikit Dask core contributor Jim Crist has put together a series of posts discussing some recent experiments combining Dask and scikit-learn on his blog, Marginally Stable. The tutorial spans three posts, which covers model parallelism, data parallelism and combining the two with a real-life dataset. (是也乎: 主要分享 涵盖模型的并行,数据并行和两个与现实生活相结合的数据集 ) Python 内脏: Hello, ceval.c! core python The “Python’s Innards” series owes its existence, at least in part, to hearing one of the Python-Fu masters in my previous workplace say something about a switch statement so large that it was needed to break it up just so some compilers won’t choke on it. I remember thinking then: “Choke the compiler with a switch? Hrmf, let me see that code.” Turns out that this switch can be found in ./Python/ceval.c. (是也乎: 追查 switch 到源代码 ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-08-04 · 4 min · 1555 words · ZoomQuiet