蠎加载 78

原文: Import Python Weekly Newsletter - Issue No 78 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Instagram 的 Python 服务效能提高 performance Instagram currently features the world’s largest deployment of the Django web framework, which is written entirely in Python. We initially chose to use Python because of its reputation for simplicity and practicality, which aligns well with our philosophy of “do the simple thing first.” But simplicity can come with a tradeoff: efficiency. Instagram has doubled in size over the last two years and recently crossed 500 million users (是也乎: Instagram 已经是世界上最大的 Django 功能集群, 用户应该也是最多 5亿了.. ) Python wats code snippet A “wat” is what I call a snippet of code that demonstrates a counterintuitive edge case of a programming language. (The name comes from this excellent talk by Gary Bernhardt.) If you’re not familiar with the language, you might conclude that it’s poorly designed when you see a wat. Often, more context about the language design will make the wat seem reasonable, or at least justified. (是也乎: 通过一段反直觉的代码, 来展示 Py 的伟大 ) Coconut - 简单,优雅的 Pythonic 函式编程 Coconut is a simple, elegant, Pythonic functional programming language that compiles to Python. Since all valid Python is valid Coconut, joining the over 30,000 people already using Coconut will only extend and enhance what you’re already capable of in Python. (是也乎: 自从世界从了 冯氏 体系后, 函式派从来就没有停止过也怀念. 又一个在 Py 身体上进行的 Lisp 还魂术… ) 在 Statsd 和 Consul 支持下从 Docker 中运行 Py3 的 REST 应用 REST Today, I’m going to go over setting up a very simple way to spin up a Python Falcon REST service that reports to Statsd as well as registering as a service with Consul along with setting up health checks. I’ve borrowed some ideas/code from several places and changed as needed. (是也乎: 基于 Falcon 的 Docker 运行时镜像的建立实战 ) Pigar 梦幻般的工具, 可以用来生成你的 Python 项目, 以及其它. (是也乎: 终于出现 pip 的二级工具了, 配合 pyenv 应该真正笑醒… 等等! 还是国人作品, 点赞! ) Django 1.10 beta 1 发布 django, release As part of the Django 1.10 release process, today we’ve released Django 1.10 beta 1, a preview/testing package that represents the second stage in the 1.10 release cycle and an opportunity for you to try out the changes coming in Django 1.10. 错过了 pycon, 最应该看什么来补 ? - Reddit Discussion video Discussion on Reddit on Pycon talk recommendations. 最合算的高可用 Django 部署 - Roland van Laar django Roland build an educational website that needed to be high available on a tight budget. Nice write up on how to achieve it. BeginnersGuide/NonProgrammers - Python Wiki resource If you’ve never programmed before, the tutorials on this page are recommended for you; they don’t assume that you have previous experience. If you have programming experience, also check out the BeginnersGuide/Programmers page. This section is hosted on the Python website and is well curated and maintained. 80 Python 课程的 策划名单 resource Learn Python online – A curated list of courses on Python 如何在 Ubuntu 16.04 的 Apache 用 mod_wsgi 发布 Django 服务? - DigitalOcean installation In this guide, we will demonstrate how to install and configure Django in a Python virtual environment. We’ll then set up Apache in front of our application so that it can handle client requests directly before passing requests that require application logic to the Django app. We will do this using the mod_wsgi Apache module that can communicate with Django over the WSGI interface specification. (是也乎: 虽然 OC 的文档一向非常的有爱, 但是, mod_wsgi 上古神器,还有必要用嘛!? ) 行者访问 Katharine Jarmul interview This interview with Pythonista Katharine Jarmul focuses on data work. A couple of events provide context. Katharine is presenting a talk titled “How Machine Learning Changed Sentiment Analysis, or I Hate You, Computer ????” at this year’s Sentiment Analysis Symposium, July 12, 2016 in New York, following which she’s offering a class, Learn Big Data Wrangling with Python, July 13-14, also in New York. (是也乎: 是时候通过 Py 的大数据分析来自行评估家庭爱情残余量了… ) Python 中的简单类型检验 code snippet Code snippet to check types. 活动 ~ Upcoming Conference / User Group Meet ...

2016-06-24 · 4 min · 1525 words · ZoomQuiet

蠎加载 77

原文: Import Python Weekly Newsletter - Issue No 77 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 让 Django 准备好 django This Blog is meant for the learners who wish to get an understanding of the framework “Django” and familiarize with web development concepts . Good entry level tutorial for Django. (是也乎: 从理解 Django 框架开始的最好的入门教程… ) Webcast: 和 Python 一起作数学题 webcast Join Amit Saha, author of Doing Math with Python, in this hands-on webcast, and learn how to use Python to solve calculus problems, make sense of numbers with graphs and statistics, do symbolic math with SymPy, and perform basic machine-learning tasks. (是也乎: Doing Math with Python 是新书, «««< HEAD 介绍了一系列数学相关的库,最后也引向了机器学习的命题. ======= 介绍了一系列数学相关的库,最后也引向了机械学习的命题. 05621f3c407be189efd9a1a68f20a4d5923eea9d ) ...

2016-06-16 · 3 min · 1455 words · ZoomQuiet

蠎加载 76

原文: Import Python Weekly Newsletter - Issue No 76 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Q&A: Guido van Rossum 有关 Python 未来策划 interview Python 创始者/仁义的暴君 Guido 老爹的采访 (是也乎: 老爹每年的公开分享, 都是 Python 的宏观规划,必须理解,在理解中理解… 简单的说:加紧 mobile 和 browser 的浸入,只是当前没有明确的好招; PyPy 很可用了, 但是 Py3 的目标也包含性能的;Py 的整体生态的是好的,没问题的. ) Python: 正则表达式介绍 core python Regular expressions are basically a tiny language all their own that you can use inside of Python and many other programming languages. You will often hear regular expressions referred to as “regex”, “regexp” or just “RE”. Some languages, such as Perl and Ruby, actually support regular expression syntax directly in the language itself. Python only supports them via a library that you need to import. The primary use for regular expressions is matching strings. You create the string matching rules using a regular expression and then you apply it to a string to see if there are any matches. (是也乎: 正则表达式几乎是一种独立语言了, 在 Py 中当然也能简洁的用起来. ) Python lambda 表达式的爆发 functional programming Lambda expressions provide a way to pass functionality into a function. Sadly, Python puts two annoying restrictions on lambda expressions. First, lambdas can only contain an expression, not statements. Second, lambdas can’t be serialized to disk. This blog shows how we can work around these restrictions and unleash the full power of lambdas. (是也乎: 如何在 Py 中真正引爆 Lambada 的能量? 用 dill 来替代 pickle! ANACONDA 内置实用序列化模块… ) 在 Python 折腾点集群 machine learning By definition, clustering is a task of grouping a set of objects in a way that objects in a particular group are more similar to each other rather than the objects in the other groups. It has multiple applications in almost every field. You can even segment your customers into different groups based on their purchase patterns. This is a Python script demonstrating the basic clustering algorithm, “k-means”. Also, it will plot the clusters using Plotly API. It uses sample data points for now, but you can easily feed in your dataset. (是也乎: 正热门的数据科学又一实例,“k-means” 完成聚类, 用 Plotly 接口进行可视化 ) Flask 规模化 flask If you are a flask user. You would greatly benefit by this pretty exhaustive (information wise) talk. Do you think that because Flask is a micro-framework, it must only be good for small, toy-like web applications? Well, not at all! In this tutorial I am going to show you a few patterns and best practices that can take your Flask application to the next level. (是也乎: 作为微型框架 flask 也可以提供大规模服务! PS: 同理 Bottle 也是可以的… ) 见 Python, 遇 Python Go, Go Python Go Today we’re going to make a Python library that is actually the Go webserver, for which we can write handlers in Python. It makes Python servers really fast, and—more importantly—it’s a bit fun and experimental. Andrey Petrov is the author of urllib3. If you have coded in Go you would realize this is pretty cool idea. (是也乎: 人生苦短, Python 当歌 !-) 从头创建 Python 框架 - Code walkthrough web framework You’re curious how web frameworks work because you want to become a better web developer. This post aims to describe what I learned by writing a small server and framework by explaining the design and implementation process step by step, function by function. (是也乎: 源发自 的框架实例… ) 5个值得爱上的 Django 包 — Medium django Lots of packages get a lot of love like django-rest-framework and wagtail, and rightfully so, they’re awesome! But I wanted to give some less well know ones some love. Pycon India CFP 来也 pycon PyCon India, the premier conference in India on using and developing the Python programming language is conducted annually by the Python developer community. It attracts the best Python programmers across the country and abroad. Submit your proposal here. 用装饰器维护 Python 硬盘缓存 code snippet Caches are important in helping to solve time complexity issues, and ensure that we don’t run a time-consuming program twice. You never know when your scripts can just stop abruptly, and then you lose all the information in your cache, and you have you run everything all over again.In order to counter this, saving your cache to a disk is something that can be very helpful in that it allows state to be saved to disk, and be retrieved from it anytime as long as its there. (是也乎: 保卫我们的运行时数据,用 修饰符, 随时导出到硬盘! ) 用 Python 从头实现神经网络 machine learning In this post we will implement a simple 3-layer neural network from scratch. We won’t derive all the math that’s required, but I will try to give an intuitive explanation of what we are doing. I will also point to resources for you read up on the details. Here I’m assuming that you are familiar with basic Calculus and Machine Learning concepts, e.g. you know what classification and regularization is. But even if you’re not familiar with any of the above this post could still turn out to be interesting ;) 用纸和 Python 实现的 Enigma 机 crytography It turns out my kids have been sending each other secret messages, enciphered with a substitution cipher of their own invention! They only let me see the secret key when I agreed to help them mix up a very complicated recipe for invisible ink. (是也乎: 二战中最强大的德军密码机,现在用纸+脚本就可以完美复刻. ) Python 类属性 core python I had a programming interview recently, a phone-screen in which we used a collaborative text editor. I was asked to implement a certain API, and chose to do so in Python. Abstracting away the problem statement, let’s say I needed a class whose instances stored some data and some other_data. As it turns out, we were both wrong. The real answer lay in understanding the distinction between class and instance attributes. (是也乎: 是的,虽然是 Python 的基础功能,但是,很少人用对味儿. ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-06-10 · 5 min · 2017 words · ZoomQuiet

蠎加载 75

原文: Import Python Weekly Newsletter - Issue No 75 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Pycon US 2016 视频和演讲幻灯 pycon, video PyCon is the largest annual gathering for the community using and developing the open-source Python programming language. PyCon is organised by the Python community for the community. Currently underway in Portland and will conclude on 5th June. The talks from the conference are getting uploaded as we speak. You should glance the videos by title and see which one you like. Speaker’s slides will be published here soon https://speakerdeck.com/pycon2016 (是也乎: PyCon15US 的相关兴趣议题的视频30+G 在硬盘中还没有看过一遍, 又来一大波…虽然发布在不存在的网站中…感觉世界总是在持续的碾压着自己… 必须首先复习: Guido van Rossum - Python Language - PyCon 2016 明确 Py2 何时正式放弃… 应该去大学, 碾压一下当下心态良好的小白们了… ) PyCon 2016: Machete-mode 调试 来自 Ned Batchelder - coverage.py 创造者 pycon, debugging Python is simpler and more fluid than other languages. Sometimes you want this fluidity, but usually you don’t. Dynamic typing means that names may have values you don’t expect. Where other languages offer access control over the internals of objects, Python lets you examine and change anything. All of your program’s data is on the heap, and can be used throughout your program. All of this flexibility can be a powerful tool, but sometimes, things go wrong. The flexibility comes back to bite us, and causes problems that we have to debug. (是也乎: Python 是如此简洁又灵活,以致有时爱到不行,有时又恨到不行, 特别是在调试时… ) 关注 Pycon 议题在 twitter #pycon2016 pyconus, twitter Takes you to the top tweets on pycon. Python & Django 安全在 Shoestring: 资源 django, security Callisto is an online reporting system. It’s written in Django and provides a more empowering, transparent, and confidential reporting experience for survivors. It’s absolutely essential that we keep our users’ data secure Thankfully, although the infosec community can sometimes be intimidating, any one of us can learn how to build secure sites using Python. This talk covers the essential concepts behind securing your users’ data and offer examples of how we applied them to Callisto. (是也乎: 大圣们曰过:“计算机系统无非两种结局,简单的看不出明显的错误,复杂的没有明显的错误;-(” ) Oneliner-izer:约束编码练习 by Chelsea Voss pyconus Curator’s note - In every office you have that one guy who tries to accomplish a whole lot of things on one line. This is a talk that you want to show them. Ideas and implementation behind Oneliner-izer, a ““compiler”” which can convert most Python 2 programs into one line of code. As we discuss how to construct each language feature within this unorthodox constraint, we’ll explore the boundaries of what Python permits and encounter some gems of functional programming – lambda calculus, continuations, and the Y combinator. (是也乎: 又一基础轮子的再造练习,涉及一些函式语言的精华: 演算/连续/Y组合… ) pep8 再次重命名为 “pycodestyle” code quality Simple Python style checker in one Python file. Good bye PEP8 :) (是也乎: 名字起的好,项目活的了, 创始胡子长,项目久的了…. 对于 EPE8 这么经典的名称的放弃,也是老拥趸弃疗的开始… ) Python 201: importlib 简介 core python Python 将 importlib 作为内建模块包含在发行版本中, 目的就是提供导入语句 (函式 __import__()). 从而赋予程序猿在导入过程中使用自定对象的能力, (类似 importer) (是也乎: 米国大学课程编号,101一般都是入门课,201就是中级课了… ) JSON 格式日志 (Python) code snippet I have created a package that outputs JSON formatted lines to a log file. It can make use of the standard logging parameters and/or take custom input. The use of JSON in the log file allows for easy filtering and processing. Episode 59 - Pillow 和 Alex Clark podcast If you need to work with images the Pillow is the library to use. The Python Image Libary (PIL) has long been the gold standard for resizing, analyzing, and processing pictures in Python. Pillow is the modern fork that is bringing the PIL into the future so that we can all continue to use it moving forward. This week I spoke with Alex Clark about what first led him to fork the project and his experience maintaining it, including the migration to Python 3. (是也乎: 对 PIL 的历史接替人: Pillow 的创造者的访谈.. ) “通过实例学习 Python 2 标准库” #PyCon2016 期间超5折优惠! The Python Standard Library by Example (for Python 2) is the eBook deal of the day during PyCon 2016. Visit theinformit.com/deals to order your DRM-free copy (PDF, ePub, andMobi) for $19.99 today! *Offer ends 11:59 PST June 1, 2016 Django Community Jobs Section | Django job market In case you weren’t aware, django website has a job section. Django REST 框架已经接受追加基金 community If you use REST framework commercially we strongly encourage you to invest in its continued development by signing up for a paid plan. Tom Christie the creator of DRF is looking to raise funds and work on it full time. Support him. Jessica mckellar 为 PyCon 带来更多的程序媛. pyconus As many of you know we have been featuring interview of django girls from a long time now. It’s very important to encourage and aid women participation. Python and Django community is at the forefront. (是也乎: 所谓一妞扺十汉 海外技术社区也异常认同, 特别是 DjangoGirls 如此成功,以至 老爹也主动开始站台推荐了… ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-06-04 · 4 min · 1879 words · ZoomQuiet