蠎加载 130

原文: Import Python Weekly Newsletter - Issue No 130 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 10分钟在 Python 3.6 用起静态数据类型检查 static type Automatically catch many common errors while coding (是也乎: 目前只有少数 IDE 比如 PyCharm 支持 py3 这种语法, 以及并没有证据表明, 在混合使用新旧数据声明的代码项目, 可以不用其它手段就可能提高运行效能. ) 用 flake8 对 python 项目自动进行代码复审 ...

2017-06-22 · 2 min · 928 words · ZoomQuiet

蠎加载 129

原文: Import Python Weekly Newsletter - Issue No 129 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… fsudoku: 快速数独解算器 codesnippet I decided to crush Sudoku, once and for all, by solving all Sudoku puzzles in one fell swoop and in less than 300 lines of Python. PyDev 周刊: Amir Rachum interview This week we welcome Amir Rachum as our PyDev of the Week. Amir is the author / maintainer of pydocstyle and yieldfrom. Amir also write a fun little blog about Python. Let’s take a few moments to get to know Amir better! (是也乎: pydocstyle / yieldfrom 的作者, 一看名字就是… <– About ) colorama codesnippet colorama allows you to print text in color on the terminal. (是也乎: 早已推荐过… from colorama import Fore, Back, Style print(Fore.RED + ‘some red text’) print(Back.GREEN + ‘and with a green background’) print(Style.DIM + ‘and in dim text’) print(Style.RESET_ALL) print(‘back to normal now’) ) ShutIt codesnippet ShutIt is an shell automation framework designed to be easy to use. (是也乎: 非-win 平台支持.. ) Timsort in Python algorithms Sorted(list) vs list.sort() Instagram 平滑升级到 Python 3 - 在 Instagram 身后的工程师 interview Four. Hundred. Million. Users. Per. Day. Not only has Instagram scaled to become the biggest Python user in the world, but the company recently moved over to Python 3 with zero user experience interruption. Instagram engineers Hui Ding and Lisa Guo talked with The New Stack to share the Python love and describe the Python 3 migration experience. (是也乎: 简单的说…没那么简单. ) Twitter 上的 NLP 广告数据 NLP I chose to perform Natural Language Processing (NLP) on Twitter data in order to assist in advertising campaigns. This project is geared more towards advertisers, marketing, and any company who wants to extend their customer relations platform to communicate with their followers. (是也乎: 简单的说, 只有商业成功的技术方案才有权力继续嗯哼… ) 用 uWSGI 在 Docker 部署迷你 Python docker So, you’ve built a great Python web application using Flask, Django, aiohttp, or Falcon. The next issue you could be facing is probably the setup regarding the deployment. We will explore how to use docker-compose to deploy a WSGI application using uWSGI and NGINX. (是也乎: 简单的说, 还是离开不能 NGNIX ) A good way to lose an afternoon reading about Python’s internals tweet TDD 课程 - By The RealPython Folks tutorial In this tutorial, you’ll learn how to quickly spin up a reproducible development environment with Docker to create a RESTful API powered by Python, Postgres, and the Flask web framework…. 极端 Lazy 来并行 Python 函式 codesnippet 用 Python 检验伪影片 codesnippet Program to detect if there are any loops in the video. 用 Python 来折腾音频信号 codesnippet Now it comes as a surprise to many people when I tell them that generating an audio waveform is extremely simple. (是也乎: 有一系列案例代码 -> 3.5-Sensor2Phone/generate_any_audio.py at master · makermovement/3.5-Sensor2Phone 项目名叫 3.5mm ~ 问题是, 已经出现倾向: 这一标准接口将消失 ) 如何用 Jupyter Notebook 从 Google Analytics 获取数据 codesnippet Today I found an online tool that can get the stats of the published articles from Google Analytics. That’s how I got interested in Google Analytics API. As I am studying Data Science at the moment, knowing how to do web analytics would open up a lot of new possibilities. (是也乎: 简单说就是配置过程太复杂了… ) Python 填字游戏拼图生成器 codesnippet Python Requests 构建 codesnippet Epithet github Introducing Epithet, a Python-based command line tool for managing labels across an organization. You give it a Github key, organization, and label name, and it will make sure that label exists across all the repos in your org. Give it a color, and it’ll make the color of that label consistent across all repos as well. Have you decided you’re done with a particular label? Epithet can delete it from all your repos for you. Are you using Github Enterprise? Epithet supports that too. (是也乎: 又一个 CLI 工具, 通过标签来管理组织的仓库… 哈. ) 搞笑 - Python 私有方法 humor (是也乎: ) RC Car + MacBook Pro = The Carputer! arduino If you’d like to build a miniature self-driving car, perhaps you would first turn to an Arduino for control or even a Raspberry Pi for more advanced processing. Otavio Good is no exception, but after attaching a few Arduinos to an RC car, he moved on to driving it with a speedometer and camera via a TensorFlow neural network running on a Macbook Pro?—?yes, it has an actual notebook computer embedded in the 1/10th-scale model car. (是也乎: ) Python 数据科学书 Jupyter 版 data science This is the Jupyter notebook version of the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub.* The text is released under the CC-BY-NC-ND license, and code is released under the MIT license. If you find this content useful, please consider supporting the work by buying the book! (是也乎: 伟大的 CC 保护下, 好书整体嗯哼成 .ipynb 了! ) Toolchest for Python shell scripters command line Curated list of tools/packages. (是也乎: 一系列 CLI 中好用的模块推荐: ~sh 嗯哼是最实用的一个 ) 对 LHL Facebook 页面回复的情感分析 machine learning Python 中的 Go-Flavored 错误处理 golang The point of this article is to present an Error class in the spirit of Go error handling and consider its use/application in Python from a personal perspective. 在 Python 中嵌入 Go 和 groupcache go Go(golang) is a very fast and efficient compiled programming language. Much like how you can build Python C-extensions to speed up your python applications, Python developers also have the option to build Go components that are embedded into their python. Python 中变量的玩耍 core-python The first one is a decorator “freezing” some global variables to their current value at the time a function is defined. 为毛 context-manager 是种更好的嗯哼? core-python 好物 ~ 包/模块/库/片段… ...

2017-06-15 · 4 min · 1880 words · ZoomQuiet

蠎加载 128

原文: Import Python Weekly Newsletter - Issue No 128 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 保持 Python 竞争力 core-python Victor Stinner sees a need to improve Python performance in order to keep it competitive with other languages. He brought up some ideas for doing that in a 2017 Python Language Summit session. No solid conclusions were reached, but there is a seemingly growing segment of the core developers who are interested in pushing Python’s performance much further, possibly breaking the existing C API in the process. (是也乎: 运行时性能爱好者们的嗯哼… ) 用 Luigi 构建并监视批量处理的管道 luigi, pipeline Luigi is a Python module that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualisation etc. It also comes with Hadoop support built in. 机器学习和数学的 Python 作弊条 machine learning Curated list of cheatsheets. (是也乎: 讲真, 图形的不如 ipynb 那种可运行的… ) PyGotham 2017 - 主题征集ing pygotham PyGotham is a New York City based, eclectic, Py-centric conference covering many topics. There’s a diverse speaker list, and some things which will be quite different. PyGotham attracts developers of various backgrounds and skill levels from the New York metropolitan area and beyond. Activities include two full days of talks, lightning talk sessions, and a social event. pyenv 和 cron pyenv Do not use /root/.pyenv/shims/python . Use direct python in pyenv. (是也乎: 其实, 更加 Pythonic 的方案是脱离 cron 使用 python 原生的定期任务模块 ) 用 10 行 Python 构建个文章基础拼写检查器 codesnippet Build a naive Article Spell-checker in 10 Lines of Python Code. Paranoid 的包检查器 security 用 Elizabeth 生成模拟数据: Part II mocking Elizabeth is a Python library, which helps generate mock data. Part II of the tutorial we shared previously. Infoblox Bulk DNS 追加 codesnippet Python 中的记录,结构,数据传输对象 core-python How to implement records, structs, and “plain old data objects” in Python using only built-in data types and classes from the standard library. (是也乎: ) 只有升级到 Py3 才能享受的 10 大极赞特性 core-python (是也乎: 可下载的 pdf 版本幻灯: 10 awesome features 高级解包 ~ 追加了变参数,以及更直觉的操作 关键词参数 ~ 能模式匹配了 Chained 异常 ~ 能返回更多信息了 更好的追踪子类 OSError 一切都能迭代了 更加严格的比较了 ~ 原先一切都能相互嗯哼不行了 yield from ~ 形式上更加明显进行嗯哼了 asyncio ~ 重点广告特性 标准库追加了几个 Fun ~ 中文|emoji 变量/类/函式名, 区分了 Unicode and bytes 矩阵运算支持 Pathlib ~ 只希望 win 系统也相同支持的更加自然… ) Apache Kafka 简介 kafka In this blog post, we’re going to get back to basics and walk through how to get started using Apache Kafka with your Python applications. Picard music Picard is a cross-platform music tagger written in Python. This is a fairly old package. 好物 ~ 包/模块/库/片段… ...

2017-06-08 · 4 min · 1619 words · ZoomQuiet

蠎加载 127

原文: Import Python Weekly Newsletter - Issue No 127 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 函式不是你所想咯 core-python, functions Python functions cannot have names. In this world view, every function is a nameless, anonymous object. Code like “def to_percent(numbers)” creates a nameless function object, then stores it in a variable called “to_percent”. (是也乎: 不同的世界观中, Py 的函式机制都可以自洽 ) Python API 清单 checklist Useful checklist for build good Python libraries APIs. Based on “How to make a good library API” PyCon 2017 talk. (是也乎: PyCon2017 最新主题分享的检查列表, ) Api Star video This is a presentation I gave at a local python user group in Nashville, PyNash. The topic of the night was to pick a lesser-known or up and coming library that many folks may not be aware of yet and give a 10 minute overview. (是也乎: ✨ 🚀 ✨ 真的解决大问题的好思路… 等等: API STAR by Anthony Fox 这种幻灯平台,简直了… ) 实现基于角色的访问控制 role easyrbac has a very simple API to interact around and create Roles and Users Ethereum 周刊 - #offtopic newsletter If you are into cryptocurrency check out Ethereumweekly.com started by a friend. It’s a weekly newsletter on all things Ethereum, Blockchain. A good way to understand what the buzz on cryptocurrency is all about. (是也乎: 有关网络安全/区块链 的周刊 ) 用 Python 和 Pandas 对价格进行分析和评级 pandas I recently began investing and was wondering how good analysts are at predicting the future of a company. 用 Machine Learning 进行文本分类 machine learning In this post, we will be trying to make a text classifier that will make use of the 20 news groups dataset originally developed by Ken Lang to classify documents into different categories based on their content. 在 Python 中用起 YAML YAML YAML stands for “YAML Ain’t Markup Language” and is mostly used in configuration files. YAML, in contrary to JSON, is made to be very readable and is not designed to be used for api’s or other communication protocols. This is because the parsing of a YAML file requires the computer a little bit more effort than parsing a JSON file. (是也乎: Yaml 虽然比 JSON 可读,但是无论创建和解析都比较嗯哼… ) 转换 cURL 指令为 Python requests curl Web app to convert syntax. (是也乎: 德政! 这才是为用户着想,将系统管理员从 shell 中扑救出来.. <– Convert curl syntax to Python, Node.js, PHP ) Riddler Nation 擂台冠军; 基于代理的建模方法 | Curtis Miller’s Personal Website numpy, pandas, quiz, puzzle Solution to Oliver Roeder puzzle in in FiveThirtyEight called “The Riddler”. 在 Python 用 Excel-样 列名来索引 codesnippet (是也乎: 就两行代码: def to_idx(letters): val = lambda i, x: (26**i) * (ord(x.lower()) - ord(‘a’) + 1) return sum([val(i, x) for i, x in enumerate(letters[::-1])]) - 1 效果: to_idx(‘A’) 0 to_idx(‘AH’) 33 to_idx(‘XFD’) 16383 ) ...

2017-06-01 · 3 min · 1242 words · ZoomQuiet