蠎加载 138
原文: Import Python Weekly Newsletter - Issue No 138 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 单元测试和模块 unittest video In this Python Programming Tutorial, we will be learning how to unit-test our code using the unittest module. Unit testing will allow you to be more comfortable with refactoring and knowing whether or not your updates broke any of your existing code. Unit testing is a must on any large projects and is used by all major companies. Not only that, but it will greatly improve your personal code as well. Let’s get started. (是也乎: 叕一个 TDD 方面的嗯哼了… ) Python 线程 - Multithreading Playlist videos, multithreading 数据科学 Rosetta Stone: 分类 在 Python, R, MATLAB, SAS, 以及 Julia | Heaton Research data science 自动将 Python 2 代码翻译成 3 的 Python 3 This web is a online converter that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code Enter your Python2 code on the left, hit the button, and boom, Python3 code on the right (是也乎: 可以嘛?敢用嘛? ) Python 队列死锁的悲伤故事 concurrency This is a story about how very difficult it is to build concurrent programs. It’s also a story about a bug in Python’s Queue class, a class which happens to be the easiest way to make concurrency simple in Python. This is not a happy story: this is a tragedy, a story of deadlocks and despair. 如何在 Python 领域成为专家? core-python Notebook based off James Powell’s talk at PyData 2017. (是也乎: 配合 youtube 的一则 ipynb 分享, metaclasses 开始… ) 仔细看看 Python f-strings 如何工作 f-strings F-strings provide a concise and convenient way to embed python expressions inside string literals for formatting. (是也乎: 针对 PEP 498 的嗯哼 ) 谁负责维护 PyPI 以及负责? pypi Reddit Discussion Hy 的小小一步 - 我的 lispy Python 经验 lisp Roughly, Hy is to Python as Clojure is to Java. Hy completely inter-ops with Python. I’ve hit commit 1,500 in my Hy project at work. I wanted to share my experience working with Hy, where I feel it shines and where it falls short. (是也乎: 等等-> Clojure LISP?! 叕一个为了 LISP 的方言, py 造… #! /usr/bin/env hy (print “I was going to code in Python syntax, but then I got Hy.”) 意思是可以用 Python 来学习 Scheme 了?! ) Python 和 Haskell 中的左右折叠->原始递归模式 haskell A “fold” is a fundamental primitive in defining operations on data structures; it’s particularly important in functional languages where recursion is the default tool to express repetition. In this article I’ll present how left and right folds work and how they map to some fundamental recursive patterns. The article starts with Python, which should be (or at least look) familiar to most programmers. It then switches to Haskell for a discussion of more advanced topics like the connection between folding and laziness, as well as monoids. (是也乎: 等等? Haskell ?! ) 用 Python 分析和测试 C c-code C is relatively difficult to write, making it harder to analyse and test. It would be helpful to be able to do this with a higher level language, such as Python. Analysis and testing don’t affect performance of the actual data structure, so using a slower but easier and more productive language for this seems reasonable. In this article, we walk though a simple example of doing this with a built-in Python library for interfacing with C called ctypes. 在 Python 中使用 GDAL / OGR 对地址进行地理编码和执行点多边形测试 geo This short post shows how to use Python packages googlemaps and GDAL. Debugging 在 Python debugging One of the reasons why I love the Python programming language is because of how easy debugging is. You don’t need a full blown IDE to be able to debug your Python application. We will go through the process of debugging a simple Python script using the pdb module from the Python standard library, which comes with most installation of Python. (是也乎: 叕一个 debug 的经验分享, 只是 print() 可以解决 99% 情况时,有什么新动力要用… ) 引入新的图像注释类型 - Python 代码片段 image processing We’re excited to be launching a bunch of new annotation types for images. Since the launch of our bounding box API, we’ve annotated millions of images with boxes to identify a host of different objects, from cars and hats to roof damage and parking lots. Scale is becoming an industry-standard tool for solving computer vision problems. 用 lehar 在终端展示数据 visualization The post is about a terminal visualization tool lehar that is open sourced at https://github.com/darxtrix/lehar (是也乎: Find commits by authors in a git repo $ git shortlog -s | cut -f1 | lehar ▇▁▁▁▁▁▁▂▃▁▁█▁▁▂▃▅▁▁▁▂▆▁▁▁▂▁▁▁▁▂▇▁▅▆▁▁▁▄▁▁█▁▁▂▁▂▁ 还有这种操作?! ) Select & Prefetch Related django Today the #DjangoTip will be about using select_related and prefetch_related to improve our queries performance. Note - Django developer do check out django newsletter - http://djangoweekly.com 好物 ~ 包/模块/库/片段… ...