蠎加载 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

蠎加载 83

原文: Import Python Weekly Newsletter - Issue No 83 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Raymond Hettinger - 并发的思考 (Pycon RU 2016) video Walk through two examples of threading and multiprocessing to illustrate rules and best practices for taking advantage of concurrency. Documentation and code from the presentation is here - https://dl.dropboxusercontent.com/u/3967849/pyru/_build/html/index.html (是也乎: 俄国PyCon! ) 又一个 Python 来搞掂的故事 ~ 用类定义构建 DSL core python We didn’t invent a new DSL, we merely adapted Python’s existing syntax to our needs. A simple class structure and a metaclass definition gave us everything we needed to build the configuration parameter files we needed. 用 Python 构建 slackbot 从而帮助自己找到 SF 的公寓 bot Scrapes listings from Craigslist. Filter out listings that don’t match our criteria. Post the listings to Slack, a team chat tool, so we can discuss and rate them. Wrap the whole process into a persistent loop and deploy it to a server (so it would run continuously). Built by Vik Paruchuri - https://twitter.com/vikparuchuri (是也乎: 其实还是对 Craigslist 进行搜索,只是控制界面变成了 Slack; 嗯哼?! 为了上班不被人发现在刷房源?! ) 每天 mypy. 第三部分 mypy Earlier this year PEP-484 was accepted, the typing module was added to Python 3.5, and mypy moved into the umbrella of official python projects. Since it was a visible topic at the last Pycon.us, I decided to get some experience with it and see how it feels to use it. I decided I’d take a working, mature, open-source project that wasn’t written by me and “convert” it to mypy. Note this is a 3 part series with a follow up. Have a look at the latest post here - http://www.machinalis.com/blog/writing-type-stubs-for-numpy/ (是也乎: 细思恐极, PEP-484 已被接受?! 意思是 py3 为了性能,已经放弃动态语言这一特性了!? ) 登记开始: Django Under the Hood 2016 ! conference Based on the videos I have watched this is a must Go ( if you can that’s ) Django Conference. A. Jesse Jiryu Davis 对话 “撰写一个优秀的编程 Blog” podcast Michael Kennedy ( guy behind the TalkPython Podcast ) and I talked about writing about programming. What kind of writing is most valuable, how do you choose a topic, improve your writing, find an audience, and find the time to write? Listen to the podcast on the Talk Python To Me site. Django 页面加速速度 django Django and Python tips and tricks on how to improve website page load times by optimizing images. words2map: 用 word2vec, t-SNE 以及 HDBSCAN 构建的推荐框架来加强 overlap.ai At overlap.ai we’re building artificial intelligence to unite people through their overlapping passions, and here we introduce a framework we call words2map for considering what our users love, like these personal passions of ours. Github repo - https://github.com/overlap-ai/words2map (是也乎: 又一个推荐服务的框架 ) 用 Python 进行 Pizza 计数 security I’m a full time nerd, even when I’m ordering pizza online I can’t stop myself from investigating how the websites I’m ordering from work. My latest investigation was Dominoes where I found a neat way to count the number of orders that they process throughout the day. This post is supposed to highlight potential dangers when exposing integer ID’s, and how they can allow someone motivated (or sad) enough to track data you might not want to share. Simple Python Code to find it out has been shared. (是也乎: 对电商的又一个私人研究实践… ) 用 Django 和 D3 构建仪表盘 — dreisbach.us django, Django Rest Framework, d3 My workplace recently collaborated with several police departments to build a dashboard showing 911 (also known as Call for Service) data, allowing users to drill down into that data. When I started on the project, there was a prototype written in dc.js, a JavaScript framework for building dynamic dashboards with all the data on the frontend, built around records from Tampa, FL. I needed to take this and make it capable of handling much more data – millions of records. I took on the task of building this using Django and D3. Along the way, I found a set of tools that worked for me. 当周 PyDev 之星 : Nicholas Tollervey interview This week we welcome Nicholas Tollervey (@ntoll) as our PyDev of the Week. He is the author of the Python in Education booklet and the co-author of Learning jQuery Deferreds: Taming Callback Hell with Deferreds and Promises. He was one of the co-founders of the London Python Code Dojo. You should check out his website to see what he’s up to. Let’s spend some time learning more about our fellow Pythonista! (是也乎: 伦敦 Python Code Dojo, 代码道场! ) 基本 Django 的 uWSGI 配置 django Here are two basic examples of almost the same uWSGI configuration to run a Django project; one is configured via an ini configuration file and the other is configured via a command line argument. This does not represent a production-ready example, but can be used as a starting point for the configuration. 活动 ~ Upcoming Conference / User Group Meet ...

2016-07-29 · 3 min · 1310 words · ZoomQuiet