蟒周刊-401-Python 2.7 今天正式退休

561 阅读5分钟

原文: PyCoder's Weekly - Issue #401

PyCoder

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

------

Python 2.7 will not be maintained past Jan 1st, 2020. So long Python 2, and thank you for your years of faithful service. Python 3, your time is now!

(是也乎:

当然, 海量 Py2.7 兼容代码, 将继续在非官方支持下良好运行到永远...

)

“The Zen of Python is not ‘the rules of Python’ or ‘guidelines of Python’. It is full of contradiction and allusion. It is not intended to be followed: it is intended to be meditated upon. In this spirit, I offer this series of meditations on the Zen of Python.”

(是也乎:

蟒之禅 的原义就是引发沉思,而不是终止之...

)

Learn how to use Python timer functions to monitor how fast your programs are running. You’ll use classes, context managers, and decorators to measure your program’s running time. You’ll learn the benefits of each method and which to use given the situation.

(是也乎:

Timer

总之: codetiming 内置计时器;

time.perf_counter() 提供精确计时;

timeit 专用运行时计时;

cProfile 专用性能分析器;

pstats CLI 性能分析工具;

KCachegrind GUI 工具来观察性能分析数据;

KcgShot3Small.gif (GIF Image, 260 × 218 pixels)

line_profiler 单行代码性能监察;

memory-profiler 内存监察工具.

)

The creator of Flask reflects on the Python 2 to 3 migration and how the Python community handled the transition. Interesting read!

(是也乎:

数字游民 不同, 移民指就基础运行平台的迁移,不象 Python 1.x -> 2.x 的迁移, 亳无压力,因为, 当年根本就没什么成规模的 1.x 工程.

所以, 技术工程迁移, 多数阻力不在技术, 而在情绪, 就象人月神话,以及其它真实软件工程心理学著作中论及的...

代码相处时间久了, 一样有感情的, 被迫迁移到完全无感觉的新平台中, 就象改嫁...

)

Some good tips and ways to minimize the context interruption when moving between the shell and a Python session.

(是也乎:

厨子说的总是有用的....)

Embedded systems engineer builds a card-sized computer that boots Linux and runs MicroPython. Cool!

(是也乎:

网红事件了...

MicroPython

已经有人准备将之复制并配置为实体 BTC 銭包了...

)

讨论

Discussions

NIL

文章,教程和嗯哼

Articles, Tutorials and Talks

“[It] seems worthwhile for me to write-up my perspective as one of the lead architects for that ecosystem on how I characterize 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.”

(是也乎:

简单的说, 还在春秋战国时代, 远没有稳定下来

)

I was a guest on Mike Kennedy’s Talk Python podcast and we discussed a shortlist of 10 interesting tutorials published on Real Python in 2019. So if you’re looking to expand your year-end reading list you’ll find some inspiration there. It’s always a treat to be on Mike’s show—definitely check out his podcast!

(是也乎:

果然, 每年必须的 top1 文章/问题/讨论都是相同的:

    如何运行你的 Python 脚本?

这其实, 也展示出了编程和非编程世界的根本差异.

)

In this step-by-step course, you’ll learn how to sort in Python. You’ll know how to sort various types of data in different data structures, customize the order, and work with two different ways of sorting in Python.

(是也乎:

Sorting

Python 丰富的数据类型, 也就意味着有丰富的排序技巧...

)

Creating data batches for model training evaluated in context of loading data using Python generators, HDF5 files and NumPy using a sound processing machine-learning model as an example.

Dummy variables (or binary/indicator variables) are often used in statistical analyses as well as in more simple descriptive statistics.

This post covers mypy in general terms as well many examples demonstrating the syntax and capabilities of this type checker.

Here you will learn how to install, uninstall, & upgrade Python packages using the pipx tool.

(是也乎:

Pipx

---w

)

(是也乎:

一本免费魔法书...

)

好物

Interesting Projects, Tools and Libraries, Projects & Code

Handles the hassle of handling the amount of fields to be serialized and queryset changes for each request for you.

(是也乎:

Astropy -> 熵, 好词儿)

(是也乎:

formula其实, FFmpeg 本身的控制界面足够稳了...

只是能将:

    ffmpeg -i input.mp4 -i overlay.png -filter_complex "[0]trim=start_frame=10:end_frame=20[v0];\
    [0]trim=start_frame=30:end_frame=40[v1];\
    [v0][v1]concat=n=2[v2];[1]hflip[v3];\
    [v2][v3]overlay=eof_action=repeat[v4];\
    [v4]drawbox=50:50:120:120:red:t=5[v5]"\
    -map [v5] output.mp4

变成:

    import ffmpeg
    in_file = ffmpeg.input('input.mp4')
    overlay_file = ffmpeg.input('overlay.png')
    (
        ffmpeg
        .concat(
            in_file.trim(start_frame=10, end_frame=20),
            in_file.trim(start_frame=30, end_frame=40),
        )
        .overlay(overlay_file.hflip())
        .drawbox(50, 50, 120, 120, color='red', thickness=5)
        .output('out.mp4')
        .run()
    )

还是值得的...

)

(是也乎:

C++ 专属领域终于也被入侵了...)

📆🐍 活动/大会

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

DAMA

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

(( ̄▽ ̄):

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

    当前 ch2
    200112 按时结束

年后第5期就来:

    200203 值得上线

)

(是也乎:

网红小视频也出现了...

最后3秒, Python 疯狂反转一切.

)

是也乎

NN 3879

101camp4py 进行中

官网 https://py.101.camp/

  • 191201 正式开课
  • 200112 按时结束
  • 5py 大年初十开始报名

蟒营™:Py入门班||图谱||幻灯||维基

Powered by: Zoom.Quiet / 昧因科技®

本文由博客一文多发平台 OpenWrite 发布!