蠎加载 94

原文: Import Python Weekly Newsletter - Issue No 94 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 介绍 Djaneiro, 专注 Django 开发的 Sublime Text 插件. django, sublime In this review I’ll explain how Djaneiro can make your Django development workflow more productive and I’ll go over the pros and cons of the plugin as I experienced them. After that I’ll take a look at alternatives to Djaneiro in the Sublime Text plugin landscape. At the end I’ll share my final verdict and ratings. (是也乎: Djaneiro ~ 专门为 subl 用户打造的 django 环境… 由于出色的接口, subl 现在比 eclipes 当年的插件社区还要活跃… ) PyData DC 2016 –5种 Python 函式 core python Talk by Steven F. Lott. Python AST 探险家 AST Write Python code and see how the ast looks like in the browser right now. No installation needed. (是也乎: 在线实时代码编译结构观察服务 ) Python 作弊条 resource This project tries to provide a lot of piece of Python code that makes life easier. (是也乎: 其实就是 mini 版本的 Python Cookbook 使用 virtualenv 发布本地文档网站 ) pandasql: 让 Python 讲 SQL sql pandasql, a Python package we (Yhat) wrote that emulates the R package sqldf. It’s a small but mighty library comprised of just 358 lines of code. The idea of pandasql is to make Python speak SQL. For those of you who come from a SQL-first background or still “think in SQL”, pandasql is a nice way to take advantage of the strengths of both languages. (是也乎: 作为 Rodeo IDE 插件诚意之作; 只有 358 行代码! ) 用来学习二叉树的 Python 库 opensource project BinaryTree is a minimal Python library which provides you with a simple API to generate, visualize and inspect binary trees so you can skip the tedious work of mocking up test trees, and dive right into practising your algorithms! Heaps and BSTs (binary search trees) are also supported. Patat – 又一个终端上的幻灯工具,基于 Pandoc opensource project patat (Presentations And The ANSI Terminal) is a small tool that allows you to show presentations using only an ANSI terminal. It does not require ncurses. (是也乎: ) PyCon 2017 网站已上线 pycon PyCon 2017 ( US ) site is live. Note - Registration starts on Oct 17th. If you are looking to speak/attend reach out dates for talk/tutorial/paper aka Call For Proposals ( CFP ) submission. 异步 Python: 不同机制的并发 - By Abu Ashraf Masnun concurrency In this post we shall explore the different ways we can achieve concurrency and the benefits/drawbacks of them. With the advent of Python 3 the way we’re hearing a lot of buzz about “async” and “concurrency”, one might simply assume that Python recently introduced these concepts/capabilities. But that would be quite far from the truth. We have had async and concurrent operations for quite some times now. Also many beginners may think that asyncio is the only/best way to do async/concurrent operations. 功能性 Python core python Functional programming is a discipline, not a language feature. It is supported by a wide variety of languages, although those languages can make it more or less difficult to practice the discipline. Python has a number of features that support functional programming, including map/reduce functions, partial application, and decorators. (是也乎: 功能性编程,而不是函式编程,又一门新的编程学科… ) Python 旋风之旅 python3 Jake VanderPlas explains Python’s essential syntax and semantics, built-in data types and structures, function definitions, control flow statements, and more, using Python 3 syntax. (是也乎: 针对 Py3 新用户的简介 ) 介绍 Python 图像库 / Pillow pillow The Python Imaging Library or PIL allowed you to do image processing in Python. Here is a tutorial. (是也乎: 瞌睡送枕头,对于图像处理,现在都用 Pillow 了 ) 用 Python 如何构造图像间的差异 image processing, pillow For the past couple of years, I’ve been writing automated tests for my employer. One of the many types of tests that I do is comparing how an application draws. Does it draw the same way every single time? If not, then we have a serious problem. An easy way to check that it draws the same each time is to take a screenshot and then compare it to future versions of the same drawing when the application gets updated. 获得 Python 模块的所有属性名称和类型 code snippet This recipe shows how to get the names and types of all the attributes of a Python module. This can be useful when exploring new modules (either built-in or third-party), because attributes are mostly a) data elements or b) functions or methods, and for either of those, you would like to know the type of the attribute, so that, if it is a data element, you can print it, and if it is a function or method, you can print its docstring to get brief help on its arguments, processsing and outputs or return values, as a way of learning how to use it. (是也乎: 也只有 Python 这种有足够内省能力的语言,才可以随时拷问出这么丰富的信息来; 代码来自: http://jugad2.blogspot.in/2016/10/get-names-and-types-of-python-modules.html ) 活动 ~ Upcoming Conference / User Group Meet Python Northwest PyCon CZ 2016 PyCon HK 2016 PyCon Finland 2016 PyCon Ireland 2016 PyCon Canada 2016 项目 ~ 包/模块/库/片段… ...

2016-10-14 · 4 min · 1688 words · ZoomQuiet

蠎加载 93

原文: Import Python Weekly Newsletter - Issue No 93 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 为 Python 开发者配置 Sublime Text sublime We have been sharing Daniel’s articles and videos from this youtube channel dedicated to Python and Sublime for a while now https://www.youtube.com/channel/UCI0vQvr9aFn27yR6Ej6n5UA . Today Daniel published his book on Sublime Text for Python Developers. Have a look if you use sublime text. Here is a 30% discount for all ImportPython Subscribers. (是也乎: 价值 $29 的课程 ) 用 Flask 和 SQLAlchemy 实现 “Soft Delete” 模式 flask, SQLAlchemy You can find lots of reasons to never delete records from your database. The Soft Delete pattern is one of the available options to implement deletions without actually deleting the data. It does it by adding an extra column to your database table(s) that keeps track of the deleted state of each of its rows. This sounds straightforward to implement, and strictly speaking it is, but the complications that derive from the use of soft deletes are far from trivial. In this article I will discuss some of these issues and how I avoid them in Flask and SQLAlchemy based applications. (是也乎: 简单的说, 手写 SQL 可以轻易作的事儿,在 ORM 世界中,嗯哼… ) 通过 Python 的 Data Visualization Landscape 进行动态游历(包含 ggplot 以及 Altair) data visualization Comprehensive listing of all data visualization packages with small codesnippets. 在 Django 折腾并发数据的正确姿势 django Guilherme Caminha explores the utility of using on_commit hook available from 1.9 onwards in sequencing part of a time consuming task in django view and rest offloaded to an async process. 思考一下协程 async-io Lukasz Langa uses asyncio source code to explain the event loop, blocking calls, coroutines, tasks, futures, thread pool executors, and process pool executors. (是也乎: 这是 go 的核心竞争力,其实 py 也早已有了对应的机制,只是…. ) 自动为 click 应用生成 man 说明 opensource project Click is my go to Python package for creating command line applications. click-man will generate one man page per command of your click CLI application specified in console_scripts in your setup.py. (是也乎: http://click.pocoo.org/ 对的只出精品的 pocoo 团队的 CLI 工具包 ) 当周PyDev: Bryan Van de Ven interview Bryan is a core developer of the Bokeh project, which is a visualization package for Python. He has also helped with the development of Anaconda. (是也乎: 名字有 van 的, 都是贵族后代, 同时在 Anaconda 和 数据可视化领域都有深入的强人… ) Flashlight 是分析及解决四旋翼控制问题的轻量级 Python 库. Flashlight enables you to easily solve for minimum snap trajectories that go through a sequence of waypoints, compute the required control forces along trajectories, execute the trajectories in a physics simulator, and visualize the simulation results. (是也乎: 当然,不是 DJI 开源的 ) Church opensource project Church is a library to generate fake data. It’s very useful when you need to bootstrap your database. (是也乎: 专注自动生成徦数据的库,再也不用折腾 SQL 了… ) 5 music things and Python Raspberry and Python projects/scripts. (是也乎: ) validr A simple,fast,extensible python library for data validation. (是也乎: 简单,快速,可拓展的数据校验库; 国人作品, 仅支持 Py 3.3+; 使用 tox 管理 pytest 测试案例… 私人官网果然也关注了 “新人到底需要什么” 长线讨论: Python入门指北 ) 活动 ~ Upcoming Conference / User Group Meet Santa Cruz Python Meetup Python Brasil [12] PyCon Ireland 2016 PyCon Canada 2016 PyData Cologne 2016 GeoPython 2017 项目 ~ 包/模块/库/片段… ...

2016-10-08 · 3 min · 1099 words · ZoomQuiet

蠎加载 92

原文: Import Python Weekly Newsletter - Issue No 9 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 别名命令配合 virtualenv 玩的更好 Over the years, I’ve come up with my own Python aliases that play nice with virtual environments. For this post, I tried to stay as generic as possible such that any alias here can be used by every Pythonista. (是也乎: 使用 bash 中的配置别名也一样 ) 保持 Django 应用性能的详细记录. django, performance “Keep detailed records of the performance of your Django code.”. django-perf-rec is like Django’s assertNumQueries on steroids. It lets you track the individual queries and cache operations that occur in your code. This blog post explains the workings of this project https://tech.yplanapp.com/2016/09/26/introducing-django-perf-rec/ . 上周未工程师的实用 ML 分享 #pyconuk machine learning Last weekend I had the pleasure of introducing Machine Learning for Engineers (a practical walk-through, no maths) at PyConUK 2016 ( Video link on page ). My talk covered a practical guide to a 2 class classification challenge (Kaggle’s Titanic) with scikit-learn, backed by a longer Jupyter Notebook (github) and further backed by Ezzeri’s 2 hour tutorial from PyConUK 2014. Python 中的 Mocks 和 Monkeypatching testing This tutorial will help you understand why mocking is important, and show you how to mock in Python with Mock and Pytest monkeypatch. Abu Ashraf Masnun: 介绍 Django Channels Yet another introduction to Django Channels. This one is a lot more clear and step by step tutorial. If you still don’t know what Django channels is / how to get started, read this. (是也乎: 又一篇 Django Channels 的介绍, 可想是个多么复杂难言的功能点 ) Python Mocks: 温柔的介绍 - 部分1和2 testing, mock In this series of posts I am going to review the Python mock library and exemplify its use. I will not cover everything you may do with mock, obviously, but hopefully I’ll give you the information you need to start using this powerful library. Note it’s a two part series as of now, here is the second part’s url http://blog.thedigitalcatonline.com/blog/2016/09/27/python-mocks-a-gentle-introduction-part-2/#.V-ysf9HhXQo Decorators: 函式的功能 - 周末和 Trey Hunner 聊 Python webcast, video Decorators are one of those features in Python that people like to talk about. Why? Because they’re different. Because they’re a little weird. Because they’re a little mind-bending. Let’s talk about decorators: how do you make them and when should you use them? 简洁的图表和数据集 REST APIs charts The Plotly V2 API suite is a simple alternative to the Google Charts API. Make a request to a Plotly URL and get a link to a dataset or D3.js chart. Python code snippet are included on the page. (是也乎: Plot.ly 如日中天时,高调开源后,依然猛烈… ) Python 代码复审: Unplugged – 第 2 集 - Daniel Bader code review Daniel is doing a series of code review sessions with Python developers. Have a look at the accompanied video where he gives his opinion on a open source project by Milton. Python 的 C 面 c binding CPython, the primary implementation of Python used by millions, is written in C. Python core developers embraced and exposed Python’s strong C roots, taking a traditional tack on portability, contrasting with the “write once, debug everywhere” approach popularized elsewhere. The community followed suit with the core developers, developing several methods for linking to C. This has given us a lot of choices for interfacing with c, let us look at them. (是也乎: 又是 paypal 团队的分享, 看来 Py 在 paypal 家折腾的不轻… ) Django 技巧 #15 基于 Mixins 使用 Class-Based Views django General rules to use mixins to compose your own view classes with code examples. 如何设置 tab completion 来用 django-admin.py 和 manage.py ? django In this short article Mike shows us how to set auto complete for django-admin.py / manage.py arguments. Specially helpful if you have tons of management commands. M$ 中的 Python 工程 core python That’s the opening paragraph from the Python Insider blog post discussing the 2016 Python core sprint that recently took place. In the case of Microsoft’s participation in the sprint, both Steve Dower and I (Brett Cannon) were invited to participate (which meant Microsoft had one of the largest company representations at the sprint). Between the two of us we spent the week completing work on four of our own PEPs for Python 3.6: Adding a file system path protocol (PEP 519), Adding a frame evaluation API to CPython (PEP 523), Change Windows console encoding to UTF-8 (PEP 528), Change Windows filesystem encoding to UTF-8 (PEP 529). (是也乎: 发明了软件的 M$ ,好象没有哪个领域不掺合的 ) GitHub - beanbaginc/django: 非官方安全后端 Django: The Web framework for perfectionists with deadlines. security This is an unofficial fork of Django, which focuses entirely on backporting official, publicly-announced security fixes to Django 1.6.11. It does not contain any other bug fixes or features, and any branches other than security-backports/1.6.x are unlikely to be up-to-date. 活动 ~ Upcoming Conference / User Group Meet Reunión Python Valencia Sydney Python User Group PyConES - Almería Edmonton Python User Group IndyPy Monthly Meetup Python Brasil [12] Santa Cruz Python Meetup 项目 ~ 包/模块/库/片段… ...

2016-09-29 · 3 min · 1429 words · ZoomQuiet

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