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

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