蠎加载 91

原文: Import Python Weekly Newsletter - Issue No 91 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 俺出席在 新德里的 Pycon India 2016 importpython Hey guys, this is Ankur. Curator behind ImportPython. Will be attending PyconIndia. Happy to meet you all and discuss all things Python. Get your opinion on the newsletter, How to make it better ?. Ping me on ankur at outlook dot com or just reply to this email. I will respond back. See you there. (是也乎: Ankur 就是 ImportPython 的作者,原来是 印度人… ) 在 Quora 用 Python 和 asynq 进行异步编程 async-io asynq is a library for asynchronous programming in Python with a focus on batching requests to external services. It also provides seamless interoperability with synchronous code, support for asynchronous context managers, and tools to make writing and testing asynchronous code easier. asynq was developed at Quora and is a core component of Quora’s architecture. See the original blog post here. (是也乎: 嗯哼, 又一个没有进入 build-in 的优秀模块 其实,公司想成名, 将公司名嵌入到著名的开源模块中,一直是非常好的渠道. ) Python 包管理生态 - Nick Coghlan packaging There have been a few recent articles reflecting on the current status of the Python packaging ecosystem from an end user perspective, so it seems worthwhile for me to write-up my perspective as one of the lead architects for that ecosystem on how I characterise the overall problem space of software publication and distribution, where I think we are at the moment, and where I’d like to see us go in the future. (是也乎: 少见的长篇大论, 追根溯源 Python 包管理的的历史和发展; 这已经不是头一家从根儿上重构 py 包发行机制的尝试了. 当然, 事实也证明, 从一开始不完美的事物,往往能在其后发展出创始人也无法想象的花活儿来. 参考 JavaScript … 嗯哼, 那个连姓名都故意乱起的语言. ) 用 pkgsrc 部署现代 Python 应用到古老的基础设施上 infrastructure This team is responsible for supplying a variety of web apps built on a modern stack (mostly Celery, Django, nginx and Redis), but have almost no control over the infrastructure on which it runs, and boy, is some of that infrastructure old and stinky. We have no root access to these servers, most software configuration requires a ticket with a lead time of 48 hours plus, and the watchful eyes of a crusty old administrator and obtuse change management process. The machines are so old that many are still running on real hardware, and those that are VMs still run some ancient variety of Red Hat Linux, with, if we’re lucky, Python 2.4 installed. (是也乎: 就是上篇文章的另外一个分支, 分享 PayPal 的折腾成果. ) 创作公众可读的 Python notebooks ipython The notebook functionality of Python provides a really amazing way of analyzing data and writing reports in one place. However in the standard configuration, the pdf export of the Python notebook is somewhat ugly and unpractical. In the following I will present my choices to create almost publication ready reports from within IPython/Jupyter notebook. (是也乎: 讲真, 每次见到这么细心的一点点解决 LeTaX 和现实世界结合的分享, 就看见了20年前的 王珢 孤独的宣传 Emacs+TeX 的身影 ) SF Pybay 大会视频 Paul Bailey, “A Guide to Bad Programming”, at PyBay2016 was my fav talk amongst all. Check out the youtube channel. (是也乎: 哈! 其实烂代码指南比好代码手册,要更加有用的. ) 压缩和增强手写笔记 image processing I wrote a program to clean up scans of handwritten notes while simultaneously reducing file size. Some of my classes don’t have an assigned textbook. For these, I like to appoint weekly “student scribes” to share their lecture notes with the rest of the class, so that there’s some kind written resource for students to double-check their understanding of the material. The notes get posted to a course website as PDFs. (是也乎: ~ Left: input scan @ 300 DPI, 7.2MB PNG / 790KB JPG. Right: output @ same resolution, 121KB PNG 简单的说,经过复杂的处理,终于可以免去重新用电脑整理课堂笔记的事儿了! 大体积的扫描件经过处理,就能变成又小又清晰的 pdf 来卖了! ) Python 中的图像处理 - 教程 image processing This tutorial will show you how to transform an image with different filters and techniques to deliver different outputs. These methods are still in use and part of a process known as Computer-To-Plate (CTP), used to create a direct output from an image file to a photographic film or plate (depending on the process). Note - It’s a pretty good article that makes uses of Python 3, Pillow and is well written. (是也乎: WoW 强烈历史感的科普文, 将出版的图像处理和 python 的结合聊明白了. ) 每周聊 Python: 学习 Django 的技巧 video This is a Weekly Python Chat live video chat events. These events are hosted by Trey Hunner. This week Melanie Crutchfield and he are going to chat about things you’ll wish you knew earlier when making your first website with Django. Much watch for newbies building websites in Django. 2 步认证在 Django security If you are looking to implement 2 Factor Authentication as part of your product and don’t know where to start read this. 活动 ~ Upcoming Conference / User Group Meet PyCon DE 2016 PyCon CZ 2016 PyCon Ireland 2016 PyHPC 2016 PyData Cologne 2016 项目 ~ 包/模块/库/片段… ...

2016-09-22 · 4 min · 1550 words · ZoomQuiet

蠎加载 90

原文: Import Python Weekly Newsletter - Issue No 90 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 在 Python 中的实时数据流管道 streaming Motorway is a real-time data pipeline, much like Apache Storm - but made in Python :-) We use it over at Plecto and we’re really happy with it - but we’re continously developing it. The reason why we started this project was that we wanted something similar to Storm, but without Zookeeper and the need to take the pipeline down to update the topology. (是也乎: 类似 Apache Storm/Amazon SQS/Kinesis 的有界面数据流构建平台 ) 与数据流一起工作: 使用 Twitter API 捕获 tweets twitter This tutorial tries to teach event driven programming by making use of streaming API offered by twitter. 介绍 Python 生成器 generators In this guide we ’ll cover generators in depth . We ’ll talk about how and why to use them , the difference between generator functions and regular functions , the yield keyword , and provide plenty of examples.This guide assumes you have a basic knowledge of Python ( especially regular functions).Throughout this guide we are going to work towards solving a problem . (是也乎: 又一篇极简说明好文. ) Python 3.6.0 beta 1 发布! python3 Python 3.6.0b1 is the first of four planned beta releases of Python 3.6, the next major release of Python, and marks the end of the feature development phase for 3.6. There are quite many new features have a look. (是也乎: 对于 打死不用 Py3 党 成员而言, 历史模块库的不兼容, 是一个怎么也绕不过去的门槛. ) Channels 进入正式 Django 项目通道 django The Django team is pleased to announce that the Channels project is now officially part of the Django project, under our new Official Projects program. Channels is the effort to bring WebSockets, long-poll HTTP, and other non-request-response protocol and business logic handling to Django, as part of our ongoing effort to establish what makes a useful web framework in 2016. 在 Django 中测试日期 testing Django makes unit & functional testing easy (especially with WebTest). Tests on routing, permissions, database updates and emails are all straightforward to implement but how do you test dates & time? You might for example want to test regular email notifications. 介绍 Django Channels django The idea behind Channels is quite simple. To understand the concept, let’s first walk through an example scenario, let’s see how Channels would process a request. 节目 74 - Python 在 Zalando podcast, community Open source has proven its value in many ways over the years. In many companies that value is purely in terms of consuming available projects and platforms. In this episode Zalando describes their recent move to creating and releasing a number of their internal projects as open source and how that has benefited their business. We also discussed how they are leveraging Python and a couple of the libraries that they have published. (是也乎: Zalando 是又一个 Python 重度依赖公司,分享他们的折腾历史. ) 得书: 赢取 “Python 201” books To win your copy of this book, all you need to do is come up with a comment below highlighting the reason “why you would like to win this book”. Try your luck guys :) 机器学习一年记 machine learning Only people with masters degrees or Ph.D’s work with machine learning professionally isn’t true. The truth is you don’t need much maths to get started with machine learning, and you don’t need a degree to use it professionally. Here is Per Harald Borgen journey. Yes he is using Python. (是也乎: 传说机器学习得至少硕士以上学历的人才玩的了, 作者证明了,这不是真的…嗯哼. ) 在 JavaScript, Python, 和 Go 中对同一个算法的 12 个实现版本 languages I recently had to write nearly the same code in Go and Python on the same day, and I realized I had written it many times before in different languages. But it does point up some interesting language differences. This article explores many different ways to write the same code (是也乎: 简单的说, 算法优化到最后, Python 一行搞店, 其它语言, 嗯哼… ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-09-15 · 3 min · 1323 words · ZoomQuiet

蠎加载 89

原文: Import Python Weekly Newsletter - Issue No 89 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 通过 Python 使用 Markov Chains 来构建 Slack bot 模拟同事. bot Imagine in your company slack team there’s this person (we’ll call him Jeff). Everything that Jeff says is patently Jeff. Maybe you’ve even coined a term amongst your group: a Jeffism. What if you could program a Slack bot that randomly generates messages that were undeniably Jeff? (是也乎: 西乔精确的预测了相同的 bot 在微信中诞生后导致人类灭亡的故事 ) Python 中是否有三元计算符? core python Learn how to use Python’s ternary operator to create powerful “one-liners” and enhance logical constructions of your arguments. (是也乎: 必须有, 不过,何必? ) 500行以内 | 用 Python 完成一个 Python 的解释器 Byterun is a Python interpreter implemented in Python. Through my work on Byterun, I was surprised and delighted to discover that the fundamental structure of the Python interpreter fits easily into the 500-line size restriction. This chapter will walk through the structure of the interpreter and give you enough context to explore it further. The goal is not to explain everything there is to know about interpreters—like so many interesting areas of programming and computer science, you could devote years to developing a deep understanding of the topic. (是也乎: 这几乎就是 PyPy 的诞生机制… PS: 500行内 已经成为 github 中包含最多脑洞的可用项目了… ) 第 73 集 - Alex Martelli Note from curator - I met Alex at Pycon Singapore / Py APAC as it was called then, I found him inspirational. We sat down and talked about Java developer’s obsession with design patterns. It was a blast. I wonder if he would remember. Here is a podcast where he is interviewed. Alex Martelli has dedicated a large part of his career to teaching others how to work with software. He has the highest number of Python questions answered on Stack Overflow, he has written and co-written a number of books on Python, and presented innumerable times at conferences in multiple countries. We spoke to him about how he got started in software, his work with Google, and the trends in development and design patterns that are shaping modern software engineering. (是也乎: Alex 是 Stack Overflow 中有关 Python 问题回答最多的人. 采访中分享了很多在 google 以及软件工程上的体验 ) Machinalis: OCR 和 Django 以及 Tesseract django, OCR A Django site that integrates with Tesseract to provide an OCR service. 使用消息框架 django Tutorial on how to use messages framework. 分版本统计 pip 的下载总量 benchmark Wow 3.x isn’t far behind. Couple of years may be. I see more and more companies using 3.x series for newer projects. (是也乎: 基本上差了一个量级… Py3 和 Py2 ) 连续分析新闻: 介绍 GeoViews GeoViews is a new Python library that makes it easy to explore and visualize geographical, meteorological, oceanographic, weather, climate, and other real-world data. GeoViews was developed by Continuum Analytics, in collaboration with the Met Office. GeoViews is completely open source, available under a BSD license freely for both commercial and non-commercial use, and can be obtained as described at the Github site. (是也乎: BSD 许可的 GeoViews 是一个完备的地理数据分析/展示相关的库. 可以轻巧的生成可互动的地理相关可视化图谱! 以上这图就是一行代码: url = ‘https://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi’ gv.WMTS(url, layer=‘VIIRS_CityLights_2012’, crs=crs.PlateCarree(), extents=(0, -60, 360, 80)) ) Mike Driscoll: 当周PyDev: Reinout van Rees interview This week we welcome Reinout van Rees (@reinoutvanrees) as our PyDev of the Week! Reinout is the creator / maintainer of zest.releaser. He has a nice website that includes a Python blog that you might want to check out. I would also recommend checking his Github page to see what projects he’s a part of. Note - We have been including Reinout van Rees blogposts for long time now in importpython. Here you can know more about the person behind the blog. (是也乎: 又一位 van ;-) zest.releaser 的作者, 带大家如何分析一位程序猿的网络数据 ) Chris Moffitt: 从列表和字典构建 Pandas DataFrames pandas Whenever I am doing analysis with pandas my first goal is to get data into a panda’s DataFrame using one of the many available options. For the vast majority of instances, I use read_excel , read_csv , or read_sql . There are multiple methods you can use to take a standard python datastructure and create a panda’s DataFrame. For the purposes of these examples, I’m going to create a DataFrame with 3 months of sales information for 3 fictitious companies. (是也乎: 享受 Pandas 的便利,第一步就是将数据倒入为 DataFrames … ) 18 个最常见的 Python 列表问题 Go find how many you can answer (是也乎: 发布的网站倒是值得关注: datacamp.com 在线自学 R/Py 进行数据科学研究… ) Python 201 正式发布! book review Mike Driscoll’s second book Python 201: Intermediate Python is out. (是也乎: 嗯哼,封面很有爱… ) PayPal 中使用 Anaconda 进行 Python Packaging packaging At PayPal, we write and deploy our fair share of Python, and we wanted to devote a couple minutes to our story and give credit where credit is due. For conclusion seekers, without doubt or further ado: Continuum Analytics’ Anaconda Python distribution has made our lives so much easier. For small- and medium-sized teams, no matter the deployment scale, Anaconda has big implications. But let’s talk about how we got here. (是也乎: 历史原因… ) csssdbpy cssdbpy is a simple SSDB client written on Cython. Faster standart SSDB client. Semaphore Community: Dockerizing a Python Django Web Application docker Get an understanding of how to dockerize your Django application, using the Gunicorn web server, capable of serving thousands of requests in a minute. (是也乎: dockerize ~ 又一个新词儿 ) Python (Windows)中快又脏 的驱动器 code snippet While using Python’s os.path module in a project, I got the idea of using it to do a quick-and-dirty check for what drives exist on a Windows system. Actually, not really the physical drives, but the drive letters, that may in reality be mapped any of the following: physical hard disk drives or logical partitions of them, CD or DVD drives, USB drives, or network-mapped drives. 有用的 python 视频德语教程系列. video Note I haven’t personally gone through the video series, the no of upvotes and views looks pretty decent. Please make your own judgement. 活动 ~ Upcoming Conference / User Group Meet ...

2016-09-08 · 4 min · 1649 words · ZoomQuiet

蠎加载 88

原文: Import Python Weekly Newsletter - Issue No 88 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… doctest — 通过文档测试 — PyMOTW 3 testing doctest tests source code by running examples embedded in the documentation and verifying that they produce the expected results. It works by parsing the help text to find examples, running them, then comparing the output text against the expected value. Many developers find doctest easier to use than unittest because, in its simplest form, there is no API to learn before using it. (是也乎: 这是进入测试最简单的形式, 但是,对于单元测试而言,并没有什么用, 只有设计精良的可测试代码, 对接口类的测试才 hold 的住… ) 用 twitter 订阅 getpy twitter If you like this newsletter and you are on twitter you want to follow getpy. Daily get selected ( 4 - 5 ) tweets super relevant to Python. (是也乎: 类似的通过 SNS 进行友好的技术新闻订阅的服务/工具/插件 有很多, 残念的是都在墙外… ) Django 用 Gunicorn 部署以及监察 django We deploy all Django applications with Gunicorn and Supervisor. I personally prefer Gunicorn to uWSGI because it has better configuration options and more predictable performance. In this article we will be deploying a typical Django application. We won’t be using async workers because we’re just serving HTML and there are no heavy-lifting task in background. Python 3 模式/技巧/约定 python3 What you see here is an early version of the book. 激进的规则: Facebook 中对 Python 文化的改进 video Today, services built on Python 3.5 using asyncio are widely used at Facebook. But as recently as May of 2014 it was actually impossible to use Python 3 at Facebook. Come learn how we cut the Gordian Knot of dependencies and social aversion to the point where new services are now being written in Python 3 and existing codebases have plans to move to Python 3.5. (是也乎: PyCon 上的分享,有关 fb 工程师为了 py3 作出的种种折腾… 值得嘛?!…. ) Brian Okken: 21: 术语: 测试夹具/皮下测试/端到端测试/系统测试 Covered in this episode: Test Fixtures, Subcutaneous Testing, End to End Testing (System Testing) . Curator’s note - Of all the podcast out there pythontesting is my fav podcast. (是也乎: 细思恐极, 又一个硬核技术的播客…. ) Reuven Lerner: 用列表解析实现 “zip” core python Simple tutorial with code snippets on zip. 自动化 OSINT: 暗网 OSINT 和 Python 第三部分: 可视化 security Welcome back! In this series of blog posts we are wrapping the awesome OnionScan tool and then analyzing the data that falls out of it. If you haven’t read parts one and two in this series then you should go do that first. In this post we are going to analyze our data in a new light by visualizing how hidden services are linked together as well as how hidden services are linked to clearnet sites. One of the awesome things that OnionScan does is look for links between hidden services and clearnet sites and makes these links available to us in the JSON output. Additionally it looks for IP address leaks or references to IP addresses that could be used for deanonymization. (是也乎: 网络安全实战系统分享,以分析 Onion 网络为实例讲解… ) 在容器引擎中运行 Django | Python | Google Cloud Platform django How to deploy Django app on Google Cloud Conda: 传说和误解 In the four years since its initial release, many words have been spilt introducing conda and espousing its merits, but one thing I have consistently noticed is the number of misconceptions that seem to remain in the (often fervent) discussions surrounding this tool. I hope in this post to do a small part in putting these myths and misconceptions to rest. (是也乎: Conda 是个传奇的 Python 发行版, 但是,在宣传中形成了很多误解,所以,作者… ) Brett Cannon: 介绍哪部电影 It’s a website to help you choose what movie you and your family/friends should watch together. Here is the code for the software https://github.com/which-film/which-film.info (是也乎: 开源了一个为家人自动推荐电影的网站代码.. ) Montreal Python 用户组: Montréal-Python 59: 召唤讲师 community, conference September is back and it’s for the Montreal Python community to gather again and share exciting new technologies and projects. This month, our friends from Ubisoft are welcoming us into their offices and are going to present to us how they are using Python and how they scaling it at large to powered some of their games. PEP-526 复审准备: 语法变量以及属性注释 core python Although type comments work well enough, the fact that they’re expressed through comments has some downsides. The majority of these issues can be alleviated by making the syntax a core part of the language. Read the PEP to know more. I think it is a very exciting PEP. (是也乎: 为了语言的运行性能修订语言形式本身, 嗯哼…. ) Python 周聊: 胶合在一起的字符串 Learn when and why you’d glue strings together using concatenation, interpolation, or other methods. 活动 ~ Upcoming Conference / User Group Meet ...

2016-09-04 · 4 min · 1680 words · ZoomQuiet