pythonista-weekly : Pyw 454

欢迎阅读《pythonista周刊》第454期。Let us start 原文: https://mailchi.mp/pythonweekly/python-weekly-issue-454 翻译:Dustyposa 来自赞助商(PS:原文的赞助商): 使用 Datadog 监控你的python指标,日志,集群分析。使用Datadog的应用分析,可以深入任何纬度并且能找到你所需要的信息,来进行动态诊断和快速故障排除。来免费试用 14 天吧! ...

2020-06-20 · 6 min · 2837 words · ZoomQuiet

Issue 425

令机器学习投入生产 原文: PyCoder’s Weekly - Issue #425 200617 Zoom.Quiet(大妈) 用时 42 分钟 完成快译 200617 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄. 令机器学习投入生产 VICKI BOYKIS Millions of web apps get deployed to production every day. But machine learning models aren’t web apps. And very few people are talking about deployment. Learn how tools like Streamlit can help take the edge off deploying your machine learning models. Python 生成器介绍 REAL PYTHON course In this step-by-step course, you’ll learn about generators and yielding in Python. You’ll create generator functions and generator expressions using multiple Python yield statements. You’ll also learn how to build data pipelines that take advantage of these Pythonic tools. (是也乎: ) 皮尤研究中心的 Python 库 PATRICK VAN KESSEL The Pew Research Center’s Data Labs team has open sources two Python libraries for wrangling files and cleaning up text documents. (是也乎: 目测, 这个研究库, 马上将被和谐. ) 异步 Python 并不快 CAL PATERSON Performance optimization is a tricky subject and silver bullets are rare. This article shines a light on some of the common misconceptions around async Python, like “async is always faster.” Related discussion on Hacker News. (是也乎: 初学者困境… 就是非常容易被这种看似公允的测试说明相信一个断言. 真实场景中: 1、异步 web 服务器不可使用 reverse proxy,因为 async server 性能高于 reverse proxy。瓶颈位置在 reverse proxy 和 wsgi 层而非 web server。使用 reverse proxy 是因为多线程 context 切换成本高,开不了很多,所以需要一个能无限开 context 的异步服务器(nginx)挡在前面。而本身异步的服务器不需要。 2、异步 web server 不可使用 connection pool 和消息队列,因为无论是协程还是纯单线程异步,协程数和连接数都用不完。由于不存在多线程或者多进程的 context 切换成本,导致只能起有限的线程数,所以需要连接池。异步的连接数用不完,所以不需要连接池,否则会成为瓶颈。 3、异步服务器在并发数超过 1000 时才会明显体现出来,sync 服务器即使在使用 reverse proxy 的情况下由于中间的代理损耗也很难处理 1000 以上的并发。我在对异步服务器做性能测试的时候,是测试程序先挺不住,真实测试异步服务器的性能的技术含量不低,初学者做不到。 这篇作品槽点太多,先说以上几点。一个个讲过来,要打一天的字。 <– 摘录隔壁群中对此文章的部分观点. 简单说, 对异步和协程的理解, 文章测试出发点就有问题. ) ...

2020-06-17 · 5 min · 2361 words · ZoomQuiet

pythonista-weekly : Pyw 453

欢迎阅读《pythonista周刊》第453期。Let us start 原文: https://mailchi.mp/pythonweekly/python-weekly-issue-453 翻译:Dustyposa 来自赞助商(PS:原文的赞助商): python开发者都需要的Vettery Vettery是一个招聘网站,它改变了人们应聘或者雇佣的方式。准备好换工作地方了吗?免费制作简历,你的薪资你说了算,现在就和顶级雇主的HR联系吧! ...

2020-06-13 · 5 min · 2246 words · ZoomQuiet

Issue 424

Flask 结合 Vue 原文: PyCoder’s Weekly - Issue #424 200610 Zoom.Quiet(大妈) 用时 42 分钟 完成快译 200610 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄. Python 中 Web 爬虫: 工具/技术和合法性 REAL PYTHON podcast Do you want to get started with web scraping using Python? Are you concerned about the potential legal implications? What are the tools required and what are some of the best practices? This week Kimberly Fessel is a guest on the Real Python Podcast to discuss her excellent tutorial created for PyCon 2020 online titled “It’s Officially Legal so Let’s Scrape the Web.” (是也乎: 从 西部世界 中才知道 host 的另外含义. ) 用 Pydantic 进行 Pedantic 配置管理 REDOWAN NAFI • Shared by Redowan Delowar Dealing with multiple configuration files for a Python application can be stressful. Learn how to take the edge off with a custom workflow centered around the Pydantic library. 异步应该如何 NIKITA SOBOLEV • Shared by Nikita Sobolev opinion Sometimes synchronous and asynchronous code can look very similar. The only difference might be the use of async and await keywords. In this opinion piece, Nikita Sobolev argues that the potential for repeated code is a design fault of Python’s asyncio framework, and describes a solution that allows synchronous Python to execute asynchronous code. 我们的 Python Monorepo DAN HIPSCHMAN Opendoor, a residential real-estate startup, has quite a few Python services. These services were spread across several git repositories, but Opendoor’s engineering team recently moved them all into a single monorepo. Learn about the challenges the team faced with many repositories and how they set-up their monorepo to solve their problems. (是也乎: 反正 Google 将 Monorepo 玩出花了, 大家就认为 Monorepo 一定香. 其实, 呵呵… ) 在 Python 展平列表的最快方法 CHRIS CONLAN Explore six different was to flatten a list of lists in Python and how their performance compares. The fastest of the six methods mentioned might surprise you! (是也乎: 其实吧, 一般撞不到这么邪的场景. ) 2020 年 Python 软件基金会董事会选举提名 PYTHON.ORG Ballots were sent out on June 8th. 讨论 Discussions ...

2020-06-10 · 4 min · 1704 words · ZoomQuiet