Planet DebugUself

December 04, 2019

蠎周刊

Issue 397

Guido 退出 Python 指导委员会

原文: PyCoder's Weekly - Issue #397

PyCoder

  • 191204 Zoom.Quiet(大妈) 用时 42 分钟 完成快译
  • 191204 Zoom.Quiet(大妈) 用时 17 分钟 完成格式转抄.

“Part of my reason is that in the end, SC duty feels more like a chore to me than fun, and one of the things I’m trying to accomplish in my life post Dropbox retirement is to have more fun. To me, fun includes programming in and contributing to Python, for example the PEG parser project.”

(是也乎:

放弃争论, 清心编程...

)

Learn what Python descriptors are and how they’re used in Python’s internals. You’ll learn about the descriptor protocol and how the lookup chain works when you access an attribute. You’ll also see a few practical examples where Python descriptors can come in handy.

(是也乎:

Descriptors

配合装饰器才能发挥作用的描述符:

...能在类上拦截对实例属性的访问,由此可以引出很多有趣的用法,和metaclass结合起来更是如此。对于Python来说"性能"似乎从来不是牺牲"功能"(以及其他各种美德)的理由,这次也不例外。

zhihu 上有人点评...

)

When you support the Python Software Foundation on Giving Tuesday you’l support organizations like the Cameroon Digital Skills Campaign. The global donatio drive runs for 24 hrs starting December 3.

After setting the PIP_REQUIRE_VIRTUALENV environment variable, Pip will no longer let you accidentally install packages if you are not in a virtual environment.

How to test Python packages as they will be installed on your users’ systems to avoid subtle bugs.

A functional programming pattern you can use to parallelize the processing of nested loops.

讨论

Discussions

NIL

文章,教程和嗯哼

Articles, Tutorials and Talks

“If you want to process a large amount data with Pandas, there are various techniques you can use to reduce memory usage without changing your data. But what if that isn’t enough? What if you still need to reduce memory usage? Another technique you can try is lossy compression: drop some of your data in a way that doesn’t impact your final results too much.”

(是也乎:

嗯哼? 意思是精确性可以不要?

)

In this tutorial, you’ll learn about the Pandas IO tools API and how you can use it to read and write files. You’ll use the Pandas read_csv() function to work with CSV files. You’ll also cover similar methods for efficiently working with Excel, CSV, JSON, HTML, SQL, pickle, and big data files.

(是也乎:

Pandas

饥饿的 Pandas 什么都能食

)

Get started working with Python, Boto3, and AWS S3. Learn how to create objects, upload them to S3, download their contents, and change their attributes directly from your script, all while avoiding common pitfalls.

(是也乎:

Boto3

这课一定有赞助

)

“You can already walk across the trading floor and see people writing Python code…it will become much more common in the next three to four years.”

(是也乎:

用了30年...当然日本还得30年

)

The bag-of-words (BOW) model is a representation that turns arbitrary text into fixed-length vectors by counting how many times each word appears.

(是也乎:

周同学的 简单说明 系列周刊推荐过, 看来真心一直在折腾事儿..

)

How to write better tests in less time by using property based testing with the hypothesis package.

好物

Interesting Projects, Tools and Libraries, Projects & Code

A collection of Python scripts for drawing beautiful figures and animating interesting algorithms in mathematics.

(是也乎:

很早就推荐过的...

Wonderland

)

(是也乎:

量子计算哪, Python 当然不会缺席

)

(是也乎:

叕一个 PRC 框架, 世界在重新,或是说, 从来没离开过 C/S 结构, B/S 一直是幻觉哪

)

(是也乎:

基于 Rust 技术, 之前试用时,无法简单编译过... 现在... )

(是也乎:

等等, Qt ? 看来不是 Emacs 真用户

)

(是也乎:

少见的 SQL 静态代码检验器, 之前,都是各家厂商自己内置的.

)

📆🐍 活动/大会

Events, MeetUp 真的是全球线下活动组织中心

DAMA

❤️ Happy Pythonic ;-(大妈私人无责任播报)

(( ̄▽ ̄):

第4期已开始, 为期6周;

200112 按时结束

年后第5期就来:

200203 可以上线

)

是也乎

NN 3851

by Pythoneerm at December 04, 2019 06:42 AM

November 30, 2019

bambooooooom

巴别塔

起因

https://www.douban.com/people/rainbowmimi/status/2711261768/

初衷

猪头小队长这个友邻是豆瓣的工程师或者 PM,我在参与内测发现 bug 的时候,他和我主动联系解决了问题。 另外,我关注了他的这段时间,我个人看法他本人就是普通的豆瓣用户,说话也没有任何让人不舒服的地方。 之前笔记功能出现特别好笑的随机图片 bug 的时候,他还会去主动回复告知 “bug 修好啦~” 这样。 他并没有关注我,我猜他只是给所有转发了那条发现 bug 的 post 的人回复告知 bug 已经修复。 经常还会看到他的某些广播很明显是豆瓣工程师们在做测试,比如某个没人用的小组,里面全是测试 post, 胡乱发的内容那种,想想还觉得有点可爱。

所以纯粹想帮小队长解释一下,他说的话明显只是抖机灵的吐槽,想象一下银酱的口气:

“喂喂喂!这么多事这么多需求哪里还招得来 PM 啊喂!岂可修!!”

这不是很可爱的吐槽么😂 可惜这位原 po 真的完全 get 不到,甚至觉得生气。。。哎,真的不在一个次元 🤦🏻‍♀️

然后、我被教育了 🙃

虽然和朋友说了之后,一位朋友说,这个人就是装逼啦,中英夹在好讨厌的感觉。我一直对这种说话方式没有太介意, 我看这位原 po 住在美帝湾区,会有这种说话方式也许是正常的吧。我是个怂人,所以我闭嘴了。

人类真的无法互相理解。

by bambooom ([email protected]) at November 30, 2019 08:42 AM

November 27, 2019

li guang he

米洛娃

米洛娃,你在干嘛!

我,我在挖坑呀,把自己埋起来。土太松软,埋住了也一直往下沉,土质不均匀,开始向左边偏过去,变成弯钩的形状,又斜斜的沉下去,上面的土扑簌簌的跟下来,糊在脸上要不能呼吸了。还是放软身段,轻轻的轻轻的呼吸,跟初中时学会的半吊子仰泳一样,只会仰面浮

November 27, 2019 01:00 PM

蠎周刊

pythonista-weekly : Pyw 425

欢迎阅读《pythonista周刊》第424期。Let us start!

原文: https://mailchi.mp/pythonweekly/python-weekly-issue-425
翻译:Dustyposa

来自赞助商:

Python 2 EOL 调查 - 你准备好了吗

Python 2的生命不久就要结束了。请为我们花费5分钟,调查你是如何为改变做准备的。你也将看到最后的结果,而且有机会得到一架无人机。Thanks for your time。做调查

走过路过不要错过!

新闻

PyCon US 2020开放注册!

PyCon将于2020年4月14日-23日在宾夕法尼亚州匹兹堡举行。早鸟票价格:公司$550,个人$350,学生$100。在卖出800张票之后,将会变为正常的价格。正常价格:公司 $700,个人$400,学生$125。

PyCon2020要来了!等待你的加入~

美国票价看起来也比较刺激~~~:) (来自穷苦的孩子)

给NumPy和OpenBLAS的新拨款!!

陈和扎克伯格基金会通过自家重要的开源软件(EOSS) 向NumPy and OpenBLAS捐赠了一笔$195,000的款项。所有的$195,000都将捐赠给Numpy的财务赞助商NumFOCUS。这笔捐款,其中$55,000将会用于OpenBLAS的工作,剩余的$140,000用于Numpy

Numpy power up!

Python Software Foundation Fellow Members for Q3 2019

会员公布~

Python Software Foundation Fellow Members for Q3 2019

文章、教程与话题

Python 指南: Zip Files - 创建和解压 Zip 文档 img(27 min)

在本视频,我们讲学习如何创建和解压Zip文档。我们将从使用zipfile模块开始,然后我们将知道如何使用shutil模块达到同样的效果。我们将学习如何使用单文件和文件夹做到这一点,以及如何使用gzip

zip get!

使用Python, Flask and Twilio 搭建 WhatsApp机器人

这篇教程向你展示了使用Python 针对 WhatsApp 的Twilio API 和 Flask框架构建WhatsApp机器人是多么简单。

站在巨人的肩膀上!

Hacking Neural Networks: 一个简短的介绍

这是一个简短的介绍,将神经网络作为进攻方式(bug 搜索,shell代码混淆,等等)以及在自然情况下充分利用神经网络进行挖掘(信息提取,恶意软件注入,后门,等等)

攻守兼备。

Tkinter教程 - 在Python教程中创建图形化用户界面 img (5h37min)

在这门面向初学者的完整课程中学习TkinterTkinter是用Python最快最简单的创建图形化用户界面的方式。Python 已经自带Tkinter了,所以没什么可以安装的了!

代码给别人看不懂?给个GUI自己调!

用 Keras and Deep Learning 识别火灾和抽烟的识别

在本篇教程,你将学习到如何使用计算机视觉,OpenCV and Keras深度学习库识别火灾和抽烟。

快速发现,智能调度消防车辆,现代社会必备呀!

但是防患于未然更重要!

我如何使用 scikit-learn 进行编码分类特征? img

在这个视频,你将学习到如何使用 OneHotEncoder and ColumnTransformer去编码你的分类特征,并且一步准备好你的分类矩阵。你也将学习到如何使用Pipeline实现这个步骤,这样你就能交叉验证你的模型的同时进行预处理。最后,你会知道你为什么处理你的数据集应该使用scikit-learn(而不是pandas)

提高处理效率~

使用SSH的非传统安全异步RESTful api

如何在Python中使用Korv and AsyncSSH 构建通过SSH 会话监听TCP sockets的安全的异步APIs

这个有点好玩,会话监听。

NumPy终极入门指南

Numpy入门所需要的一切!

所有你需要

常见数据分析库教程都有了吧~

Python List 指南: Lists, Loops, and More!

用这个Python list教程掌握列表吧!分析app store数据,并学习如何使用循环自动重复执行任务。

熟悉的知识点,新鲜的场景~

用 DTrace and cProfile 进行 Django 性能分析

官方文档中有一章介绍了性能和优化。在这篇文章,我想在官方文档的基础上,展示一些工具和我使用的方法去减少页面加载的时间。

优化进阶~

如何将awk脚本移植到Python

将awk脚本移植到Python更重要的是关于代码风格而不是代码翻译。

哪里不好用转哪里!

手机上的Jupyter (或者任何地方, really)

想想你日常生活中浪费掉的所有的downtime.在地铁上的那个小时,在车管所的那个下午,上班时服务器宕机的20分钟时候,你在等着IT部门让一切恢复正常。如果你使用那些时间做一些数据科学相关的工作不好吗?让我们开始设置Jupyter远程服务器吧!

糟了,这是心动的感觉!

从神经网络中提取知识来建立更小更快的模型

这篇文章讨论了GPT-2 and BERT模型,以及使用知识提炼使用比他们老师使用的更少的参数创建精度更高的模型。

长江后浪推前浪~

Python 3 的基础数据类型: Booleans

学习在你的Python 3代码中使用布尔(True and False)值.

在 Glitch.com 上部署 Flask 应用 img(15min)

在该视频中学习如何在glitch上部署Flask应用。

新鲜的部署~

如何在树莓派上运行 TensorFlow Lite进行目标检测 img(10min)

TensorFlow Lite是一个轻量级机器学习模型的框架,它非常适合于像树莓派这样的低功耗设备。本视频展示了如何在树莓派上设置TensorFlow Lite`去运行目标检测模型,以便在实时网络摄像头流,视频或者图片中进行定位和识别。

硬件需要玩起来!

丰富自家全靠它!

Python中多语言的影响

取其精华

Python / Pandas & BigQuery in 7 minutes

7min knowledge

如何使用 Python 从 Wikipedia 制作你自己的 Wiki

Django REST Framework Permissions in Depth

深入权限管理

如何使用机器学习过滤推特

ML全场景攻略 Point!

有趣的项目、工具和库

Quay

构建,存储和分发你的应用和容器。

部署新利器?

Deepdrive

无人驾驶端到端模拟。

人人可用!只是配置要求比较苛刻~

great_expectations

Great Expectations是一个分析,验证和记录你的数据的工具,用于维持质量的同时提升团队的沟通效率。

数据工程也需要管理~

meshio

有多种网格格式可用于表示非结构化网格。 meshio可以读取和写入多种格式,并在它们之间进行平滑转换。

数据平滑处理

Clusterman

Clusterman(集群管理器)是用于Mesos和Kubernetes集群的自动扩展引擎。 支持查看指标并可以启动或终止计算以满足您的工作负载需求,类似于官方的Kubernetes Cluster Autoscaler

用起来顺手才是最终目的!

jwt_tool

一个用于测试,伪造和破解 JWT的工具。

知己知彼

mail-sanitizer

一个清楚你的email的客户端工具。

清洁你我他

OpenNRE

一个用于神经网络关系提取(NRE)的开源包。

来自国内的小伙伴们的 NLP 包。

ytmdl

一个简单的脚本,用于从YouTube获取mp3格式的歌曲,以及来自iTunes的所有标签。

ADTK

用于在时间序列中进行无监督异常检测的Python工具包。

kaolin

用于加速3D深度学习研究的PyTorch库。

解决 Python 痛点?

rsh

rsh是一个纯粹用Python编写的工具,可以方便地为linuxwindows生成反向shell命令。

flask-dashboard-modular-admin

ModularAdmin仪表盘设计之上,以Flask Web框架编码的开放源代码管理仪表盘。

带仪表盘的后台!

Pandera

Pandas 的统计数据验证工具包。

要闻

Python in Visual Studio Code – November 2019 Release

在这个版本中,我们主要关注产品质量。我们总共解决了60个问题,其中39个是bug修复。不过,我们也很高兴提供一些令人愉快的功能,比如:

  • 使用Python服务器时增加quick fix
  • Altair 画图支持
  • Notebook Editor 中增加行号

快上新版本!

Django 3.0 release candidate 1

发布时间逐渐逼近

活动和网络研讨会日程

Basics of Natural Language Processing in Python - London, UK

多亏了Python社区,自然语言处理从未如此简单!我们将看看NLP的工具,并比较它们的不同用途,包括一些有趣的生成的写作例子!我们也将介绍一些关于语言和跨语言分析的算法。

NLP泛场景应用~

IndyPy Bytes: Making AI More Accessible to the Non-Developer - Indianapolis, IN

Python中有许多可用的AI库,但它们是为程序员设计的。我们已经在Python中构建了一些工具来降低那些现有库的进入门槛。我们及早发现常见的错误,使评估学习者的表现更容易,并可视化的学习者行为和基础数据更容易获得。我们将讨论这些决策背后的驱动因素,并通过一个简单的示例介绍如何在现成的数据集上使用此工具。

门槛肯定会越来越低~毕竟当作工具用!

Build an ML Product - 4 Mistakes to Avoid - Vancouver, BC

Austria Python Meetup November 2019 - Vienna, Austria

Posa:

❤️ Happy Pythonic ;-(Posa私人无责任播报)
残念,暂无。:(

----- 分割线 -----

如果你发现哪里翻译有误的话,请务与我联系!感谢!

by Pythoneerm at November 27, 2019 07:16 AM

pythonista-weekly : Pyw 424

欢迎阅读《pythonista周刊》第424期。Let us start!

原文: https://mailchi.mp/pythonweekly/python-weekly-issue-424
翻译:Dustyposa

来自赞助商:

Python 2 EOL 调查 - 你准备好了吗

Python 2的生命不久就要结束了。请为我们花费5分钟,调查你是如何为改变做准备的。你也将看到最后的结果,而且有机会得到一架无人机。Thanks for your time。做调查

走过路过不要错过!

新闻

PyCon US 2020开放注册!

PyCon将于2020年4月14日-23日在宾夕法尼亚州匹兹堡举行。早鸟票价格:公司$550,个人$350,学生$100。在卖出800张票之后,将会变为正常的价格。正常价格:公司 $700,个人$400,学生$125。

PyCon2020要来了!等待你的加入~

美国票价看起来也比较刺激~~~:) (来自穷苦的孩子)

给NumPy和OpenBLAS的新拨款!!

陈和扎克伯格基金会通过自家重要的开源软件(EOSS) 向NumPy and OpenBLAS捐赠了一笔$195,000的款项。所有的$195,000都将捐赠给Numpy的财务赞助商NumFOCUS。这笔捐款,其中$55,000将会用于OpenBLAS的工作,剩余的$140,000用于Numpy

Numpy power up!

Python Software Foundation Fellow Members for Q3 2019

会员公布~

Python Software Foundation Fellow Members for Q3 2019

文章、教程与话题

Python 指南: Zip Files - 创建和解压 Zip 文档 img(27 min)

在本视频,我们讲学习如何创建和解压Zip文档。我们将从使用zipfile模块开始,然后我们将知道如何使用shutil模块达到同样的效果。我们将学习如何使用单文件和文件夹做到这一点,以及如何使用gzip

zip get!

使用Python, Flask and Twilio 搭建 WhatsApp机器人

这篇教程向你展示了使用Python 针对 WhatsApp 的Twilio API 和 Flask框架构建WhatsApp机器人是多么简单。

站在巨人的肩膀上!

Hacking Neural Networks: 一个简短的介绍

这是一个简短的介绍,将神经网络作为进攻方式(bug 搜索,shell代码混淆,等等)以及在自然情况下充分利用神经网络进行挖掘(信息提取,恶意软件注入,后门,等等)

攻守兼备。

Tkinter教程 - 在Python教程中创建图形化用户界面 img (5h37min)

在这门面向初学者的完整课程中学习TkinterTkinter是用Python最快最简单的创建图形化用户界面的方式。Python 已经自带Tkinter了,所以没什么可以安装的了!

代码给别人看不懂?给个GUI自己调!

用 Keras and Deep Learning 识别火灾和抽烟的识别

在本篇教程,你将学习到如何使用计算机视觉,OpenCV and Keras深度学习库识别火灾和抽烟。

快速发现,智能调度消防车辆,现代社会必备呀!

但是防患于未然更重要!

我如何使用 scikit-learn 进行编码分类特征? img

在这个视频,你将学习到如何使用 OneHotEncoder and ColumnTransformer去编码你的分类特征,并且一步准备好你的分类矩阵。你也将学习到如何使用Pipeline实现这个步骤,这样你就能交叉验证你的模型的同时进行预处理。最后,你会知道你为什么处理你的数据集应该使用scikit-learn(而不是pandas)

提高处理效率~

使用SSH的非传统安全异步RESTful api

如何在Python中使用Korv and AsyncSSH 构建通过SSH 会话监听TCP sockets的安全的异步APIs

这个有点好玩,会话监听。

NumPy终极入门指南

Numpy入门所需要的一切!

所有你需要

常见数据分析库教程都有了吧~

Python List 指南: Lists, Loops, and More!

用这个Python list教程掌握列表吧!分析app store数据,并学习如何使用循环自动重复执行任务。

熟悉的知识点,新鲜的场景~

用 DTrace and cProfile 进行 Django 性能分析

官方文档中有一章介绍了性能和优化。在这篇文章,我想在官方文档的基础上,展示一些工具和我使用的方法去减少页面加载的时间。

优化进阶~

如何将awk脚本移植到Python

将awk脚本移植到Python更重要的是关于代码风格而不是代码翻译。

哪里不好用转哪里!

手机上的Jupyter (或者任何地方, really)

想想你日常生活中浪费掉的所有的downtime.在地铁上的那个小时,在车管所的那个下午,上班时服务器宕机的20分钟时候,你在等着IT部门让一切恢复正常。如果你使用那些时间做一些数据科学相关的工作不好吗?让我们开始设置Jupyter远程服务器吧!

糟了,这是心动的感觉!

从神经网络中提取知识来建立更小更快的模型

这篇文章讨论了GPT-2 and BERT模型,以及使用知识提炼使用比他们老师使用的更少的参数创建精度更高的模型。

长江后浪推前浪~

Python 3 的基础数据类型: Booleans

学习在你的Python 3代码中使用布尔(True and False)值.

在 Glitch.com 上部署 Flask 应用 img(15min)

在该视频中学习如何在glitch上部署Flask应用。

新鲜的部署~

如何在树莓派上运行 TensorFlow Lite进行目标检测 img(10min)

TensorFlow Lite是一个轻量级机器学习模型的框架,它非常适合于像树莓派这样的低功耗设备。本视频展示了如何在树莓派上设置TensorFlow Lite`去运行目标检测模型,以便在实时网络摄像头流,视频或者图片中进行定位和识别。

硬件需要玩起来!

丰富自家全靠它!

Python中多语言的影响

取其精华

Python / Pandas & BigQuery in 7 minutes

7min knowledge

如何使用 Python 从 Wikipedia 制作你自己的 Wiki

Django REST Framework Permissions in Depth

深入权限管理

如何使用机器学习过滤推特

ML全场景攻略 Point!

有趣的项目、工具和库

Quay

构建,存储和分发你的应用和容器。

部署新利器?

Deepdrive

无人驾驶端到端模拟。

人人可用!只是配置要求比较苛刻~

great_expectations

Great Expectations是一个分析,验证和记录你的数据的工具,用于维持质量的同时提升团队的沟通效率。

数据工程也需要管理~

meshio

有多种网格格式可用于表示非结构化网格。 meshio可以读取和写入多种格式,并在它们之间进行平滑转换。

数据平滑处理

Clusterman

Clusterman(集群管理器)是用于Mesos和Kubernetes集群的自动扩展引擎。 支持查看指标并可以启动或终止计算以满足您的工作负载需求,类似于官方的Kubernetes Cluster Autoscaler

用起来顺手才是最终目的!

jwt_tool

一个用于测试,伪造和破解 JWT的工具。

知己知彼

mail-sanitizer

一个清楚你的email的客户端工具。

清洁你我他

OpenNRE

一个用于神经网络关系提取(NRE)的开源包。

来自国内的小伙伴们的 NLP 包。

ytmdl

一个简单的脚本,用于从YouTube获取mp3格式的歌曲,以及来自iTunes的所有标签。

ADTK

用于在时间序列中进行无监督异常检测的Python工具包。

kaolin

用于加速3D深度学习研究的PyTorch库。

解决 Python 痛点?

rsh

rsh是一个纯粹用Python编写的工具,可以方便地为linuxwindows生成反向shell命令。

flask-dashboard-modular-admin

ModularAdmin仪表盘设计之上,以Flask Web框架编码的开放源代码管理仪表盘。

带仪表盘的后台!

Pandera

Pandas 的统计数据验证工具包。

要闻

Python in Visual Studio Code – November 2019 Release

在这个版本中,我们主要关注产品质量。我们总共解决了60个问题,其中39个是bug修复。不过,我们也很高兴提供一些令人愉快的功能,比如:

  • 使用Python服务器时增加quick fix
  • Altair 画图支持
  • Notebook Editor 中增加行号

快上新版本!

Django 3.0 release candidate 1

发布时间逐渐逼近

活动和网络研讨会日程

Basics of Natural Language Processing in Python - London, UK

多亏了Python社区,自然语言处理从未如此简单!我们将看看NLP的工具,并比较它们的不同用途,包括一些有趣的生成的写作例子!我们也将介绍一些关于语言和跨语言分析的算法。

NLP泛场景应用~

IndyPy Bytes: Making AI More Accessible to the Non-Developer - Indianapolis, IN

Python中有许多可用的AI库,但它们是为程序员设计的。我们已经在Python中构建了一些工具来降低那些现有库的进入门槛。我们及早发现常见的错误,使评估学习者的表现更容易,并可视化的学习者行为和基础数据更容易获得。我们将讨论这些决策背后的驱动因素,并通过一个简单的示例介绍如何在现成的数据集上使用此工具。

门槛肯定会越来越低~毕竟当作工具用!

Build an ML Product - 4 Mistakes to Avoid - Vancouver, BC

Austria Python Meetup November 2019 - Vienna, Austria

Posa:

❤️ Happy Pythonic ;-(Posa私人无责任播报)
残念,暂无。:(

----- 分割线 -----

如果你发现哪里翻译有误的话,请务与我联系!感谢!

by Pythoneerm at November 27, 2019 07:16 AM

Issue 396

Guido: 代码的可读性如此重要...

原文: PyCoder's Weekly - Issue #396

PyCoder

  • 191127 Zoom.Quiet(大妈) 用时 42 分钟 完成快译
  • 191127 Zoom.Quiet(大妈) 用时 17 分钟 完成格式转抄.

PyCon is the largest annual gathering for the community that uses and develops the open-source Python programming language. April 15–23 in Pittsburgh. Pro-tip: Get your early bird tickets today.

(是也乎:

PyCon2020 早鸟票已经有了,,,

)

KeyError exceptions are often caused by a bad key lookup in a dictionary, but there are a few other situations when a KeyError can be raised as well. Knowing how to handle these exceptions is essential to writing good Python code.

(是也乎:

KeyError

等等, 这个是常见, 但是, 不难追踪哪...

)

Timeless tutorial that teaches the basics of Unicode, and how both Python 2 and Python 3 work, as well as some key tips on solving Unicode problems.

A conversation with the creator of the world’s most popular programming language on removing brain friction for better work.

(是也乎:

Guido

全文如下:

The Mind at Work: Guido van Rossum on how Python makes thinking in code easier By Anthony Wing Kosner

Published on November 25, 2019

A conversation with the creator of the world’s most popular programming language on removing brain friction for better work.

Nothing defines the 21st century more than the ubiquitous effects of computer programming. Almost everything we do, particularly at work, is mediated by screens displaying the results of the enormous amount of computation that we now take for granted. If you’re one of the 99.7% of the human race that are not programmers, how all of this happens is a bit of a mystery. As science fiction writer Arthur C. Clarke quotably wrote, “Any sufficiently advanced technology is indistinguishable from magic.”

Of course, it isn’t magic. It is, however, both complicated and complex, with codebases of tech companies measured in millions of lines of code. When you’re reasoning about a real system you might want to build in code, you’re thinking about the complex relationships between different functions over time. Your code can be more or less complicated in how it is written and structured, but the problem you're trying to solve has an inherent complexity that can’t be reduced to something simpler.

Becoming a programmer is not just about ideas, and you won’t last long at it if you can’t deal with the laser-focused details of describing your ideas in code. “I'm a little skeptical of the claim that the systems thinking is primary there, because it's much easier to come up with an idea for a system than it is to take an idea and turn it into working code,” says Guido van Rossum, the creator and retired BDFL (Benevolent Dictator for Life) of the Python programming language. JavaScript still owns the web, and Java runs 2.5 billion Android phones, but for general purpose programming and education, Python has become the default standard.

If anyone has made turning an idea into working code easier, for more people, it’s Van Rossum over his 30-year history with Python. And he’s done it with a self-effacing grace and an understated humor—the language is named after the surreal comedy of Monty Python, not the actual Burmese python. In its quiet way, the Python programming language has managed to make some of the complications of programming computers less difficult for our brains to manage.

To understand how Van Rossum accomplished this amazing feat, we have to go back into the history of computing to the era of mainframes and machine language. “The mainframe is a machine that costs many millions of dollars, and the combined pay of all those programmers is peanuts compared to the cost of the mainframe,” he says, explaining that cost logically prioritized machine time over human time. “But as I experienced desktop workstations and PCs, I realized that a change of mindset about cost of the programmer's time versus cost of the computer's time was overdue.” Van Rossum doesn’t think he was the first person to observe this shift, but he really capitalized on it in the design of Python.

This simple idea of giving humans priority over machines is at the core of the philosophy behind Python. Certainly the fact that it’s an interpreted language as opposed to a compiled language means that the programmer gets immediate feedback about the code they’re writing without needing to take the time to recompile it after making each change. This is very common now, but thirty years ago it was quite controversial because the conventional wisdom was that faster (for the computer) was better. Updating this belief has had a large positive impact on the productivity of programmers.

“In Python, every symbol you type is essential.” —Guido van Rossum “There are a whole bunch of common programming tasks that are easy in Python,” says Van Rossum. “For someone who is not yet a programmer, who wants to become a programmer, for those people Python is particularly easy to get.” Indeed, many computer science schools are switching over from Java to Python, because it’s much easier to grasp for beginners. The reasons behind this are complex, with many factors each reducing little bits of friction. What’s simple is the philosophy behind all of the improvements: Everything should have a necessary purpose. The lack of extraneous code makes it easier to focus on what you need to pay attention to. “In Python, every symbol you type is essential,” Van Rossum says.

This concision makes it easy to accomplish something meaningful in Python, which is one of the reasons for its wide adoption. “The typical way that we introduce Python to beginning programmers is also important. We can show them very small snippets of code that require very little understanding of terminology and concepts from programming before they make sense,” Van Rossum explains, “whereas the smallest Java program, for example, contains a whole bunch of what are, to the uninitiated eye, noise characters.”

This quietness and simplicity of design makes it easier to see what’s going on. “Python for me is incredibly visual,” says Van Rossum. “When I read Python, I definitely see it as a two-dimensional structure, rather than one-dimensional, like language. That is probably because Python uses indentation for grouping, but probably also because my mind just likes thinking visually.”

He’s not the only one, of course, who thinks visually. We all do to some extent. But he’s particularly sensitive to the effects of the visual on cognition. “Some poorly formatted text can drive me crazy. They interrupt my visual parsing of the flow and the structure, and in that sense, I do think in Python,” Van Rossum admits. “I can grasp code much better when it's formatted properly.” It takes more information to resolve the uncertainty about what code indentations mean if they’re arbitrary than if those indentations have a clear purpose, as they do in Python. So if the experience is easier, it’s because fewer bits of information have to be processed for you to know what’s going on.

Python’s readability is not just typographic, but conceptual. Van Rossum thinks Python may be closer to our visual understanding of the structures that we are representing in code than other languages because, “Python makes that structure mandatory.”

"While I was researching my book, CODERS,” says author Clive Thompson, “I talked to a lot of developers who absolutely love Python. Nearly all said something like ‘Python is beautiful.’ They loved its readability—they found that it was far easier to glance at Python code and see its intent. Shorn of curly brackets, indented in elegant visual shelves, anything written in Python really looks like modern poetry." They also find that Python is fun to write, which is more important than it may seem. As Thompson writes, “When you meet a coder, you’re meeting someone whose core daily experience is of unending failure and grinding frustration.”

“You primarily write your code to communicate with other coders, and, to a lesser extent, to impose your will on the computer.” —Guido van Rossum Building the priority of the programmer’s time into the language has had a curious effect on the community that’s grown around it. There’s a social philosophy that flows out of Python in terms of the programmer’s responsibility to write programs for other people. There’s an implicit suggestion, very much supported by Van Rossum in the ways he talks and writes about Python, to take a little more time in order to make your code more interpretable to someone else in the future. Expressing your respect for others and their time through the quality of your work is an ethos that Van Rossum has stealthily propagated in the world. “You primarily write your code to communicate with other coders, and, to a lesser extent, to impose your will on the computer,” he says.

The universality of the culture that’s spread around Python has achieved some measure of what Van Rossum intended two decades ago with a short-lived project called CP4E (Computer Programming for Everybody). “I'm usually not a very visionary thinker. People always ask me, what's next for Python, and I never know. But I put on my most visionary hat, and assumed that it would make sense for everyone to learn programming.” Personal computers had been around for 20 years, but mostly they were glorified typewriters and calculators. Van Rossum asked, “isn't it crazy that all those people have computers, and very few of them learn to program?”

In the time since, he has focused on making programming easier to learn and easier to do through the advancements in Python, now at version 3.7. He still thinks that programming teaches generally valuable skills, like problem solving, following directions carefully, and understanding what directions mean. But he’s also found that, “there are certain introductions to programming that are fun for kids to do, but they're not fun for all kids, and I don't think I would want to make it a mandatory part of the curriculum.”

At the same time, the need for people to program their computers has also diminished because of the growth of software, particularly on the web, that allows you to intuitively do what used to require programing to accomplish. “I'm not so sure that it needs to happen anymore,” Van Rossum says of CP4E. “I think computers have made it to that point, where they're just a useful thing that not everybody needs to know what goes on inside.”

“Python is now also the language of amateurs, and I mean that in the best possible way.” —Guido van Rossum But that are a growing number of people who are using Python in many fields. “The currently prevailing theory about Python's unexpected success,” says Van Rossum, “is that at some point, it established itself into data science and machine learning, and scientific data processing in general, and once you have critical mass, it's easier for everyone to use the same system as their colleagues and their competitors, than to try something different.” And even though it started as purely a tool for professional programmers, Van Rossum says, “Python is now also the language of amateurs, and I mean that in the best possible way.”

A successful open source software project, like Python, has to be easy to learn for beginners, but also have practical application to real world problems that more advanced users will want to solve. Just as for beginners you want to keep things simple so all of their brain energy is spent on learning the complications of the programming environment, for advanced users you want to help them manage the complexity of these competing abstractions. Part of the motivation for making the implementation of Python as simple as possible is to be able to change your mind, to learn, to iterate. “If you write a prototype in Python and you get it to work, often, that’s not a very big effort,” says Van Rossum, “and then you can afford to throw away your prototype and write the same thing again based on what you've learned. You can still write it in Python, but the second version will be much better than the first.”

Part of the enduring appeal of Python is the optimism and humility of starting over. “If you've invested much more time into writing and debugging code, you're much less eager to throw it all away and start over.” Co-founder and CEO, Drew Houston wrote the first prototype of Dropbox in Python on a five-hour bus ride from Boston to New York. “The early prototypes of Dropbox were thrown away, largely, many times,” says Van Rossum.

What can we learn from Python about how to design better tools for thinking? Tim Peters, one of Python’s major contributors, offers some clues in the aphoristic The Zen of Python, in which he channels Van Rossum’s guiding principles. Particularly relevant to our present discussion are this pair: “Simple is better than complex. Complex is better than complicated.” This could almost be a recipe for how the brain prioritizes its functions to use energy efficiently.

Equally important for Van Rossum is the social aspect of thinking and building tools. What has he taken away from his thirty year journey with Python? “I have learned that you can't do it alone, which is not an easy lesson for me. I've learned that you don't always get the outcome that you went for, but maybe the outcome you get is just as good, or better.”

简单说:

Python 之禅 真的包含了老爹所有关键思考成果.

)

The first draft changelog for Python 3.9 alpha 1 is out, if you want to stay on top of the latest CPython developments.

How to include contextual information in your exceptions for easier root cause analysis.

(是也乎:

讲真, 内置的已经足够好了...

)

A web app outage post-mortem with useful tips and tools for testing Django migrations.

(是也乎:

Django 的 Migrations 可以说是最强大的自成体系的知名工具了...

今年 PyCon19中国 就有专门主题探索具本质行为, 只是如何测试, 涉及到外部数据库, 还真的是值得讨论的事儿...

)

讨论

Discussions

NIL

文章,教程和嗯哼

Articles, Tutorials and Talks

Brian Okken is perhaps best known as the author of Python Testing with pytest, as well as being the host of two Python-related podcasts. Find out more about the man behind the voice, his new meetup in Portland, and the advice he’d like to give to anyone who’s new to testing software.

(是也乎:

Interview

等等,这档节目一直没采访过老爹的?

)

The original title of the article is The Incredible Disaster of Python 3 so this was probably written with some frustration still fresh on someone’s mind. Nevertheless I think it’s important to look at aspects of Python that developers might be struggling with and that could be improved. Related discussion on Hacker News.

In this step-by-step tutorial, you’ll see common examples of invalid syntax in Python and learn how to resolve the issue. If you’ve ever received a SyntaxError when trying to run your Python code, then this is the guide for you.

(是也乎:

Syntax

语法错误应该是最友好和常见的警告了...

但是, 这又是阻止小白们进入自由世界最大的坑...

)

Kelly and Sean interview Eric Matthes, author of Python Crash Course, about how he began programming, what led him to teaching, and the important lessons from Python to be learned both inside and outside of the classroom.

How to get started with fNIRS sensing data specifically oxygenated hemoglobin “HbO2/HbO” data for analyzing a data stream from a sensor.

How the python-papi package can be used to measure the FLOP requirements of any section of a Python program.

(是也乎:

输入:

import sympy as sp
sp.init_printing() # or init_session(). init_session does much more
x = sp.Symbol('x')
sp.pprint(sp.Integral(sp.sqrt(1/x), x))

获得:

           
     ___   
     1    
       dx
 ╲╱   x    

可以说很萌了... 数学计算一直是计算机的核心使命, 只是数学各种专用符号, 以往都在 TeX 基础上折腾, 没想到, ASCII-art 果断没放弃...

)

好物

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

前几期推荐过...专注管理预期失败的测试案例 )

(是也乎:

叕一个试图网络化 Pandas 运算的模块

)

(是也乎:

兰莓

)

(是也乎:

JIT 技术越来越嗯哼了

)

(是也乎:

叕一个时序相关模块, 可见大数据后, 时序数据正在兴起

)

(是也乎:

Mitogen

嗯哼? 立志作 fab/inv/Ansible 们的基础框架...

简直就是使用 蠕虫病毒 原理来完成自动复制和扩散....

)

📆🐍 活动/大会

Events, MeetUp 真的是全球线下活动组织中心

DAMA

❤️ Happy Pythonic ;-(大妈私人无责任播报)

(( ̄▽ ̄):

第4期已开始, 为期6周;

200112 按时结束

第5期年后再来:

200203 应该上线

)

是也乎

NN 3837

by Pythoneerm at November 27, 2019 06:42 AM