background preloader

PyNils

Facebook Twitter

Safe method invocation. Four Tricks for Comprehensions in Python.

Middleware

The Hitchhiker’s Guide to Python! — The Hitchhiker's Guide to Python. Python 3 Patterns, Recipes and Idioms — Python 3 Patterns, Recipes and Idioms. Epub. GraphViz Workspace. Improve Your Python: 'yield' and Generators Explained. Prior to beginning tutoring sessions, I ask new students to fill out a brief self-assessment where they rate their understanding of various Python concepts.

Improve Your Python: 'yield' and Generators Explained

Some topics ("control flow with if/else" or "defining and using functions") are understood by a majority of students before ever beginning tutoring. There are a handful of topics, however, that almost all students report having no knowledge or very limited understanding of. Of these, "generators and the yield keyword" is one of the biggest culprits. I'm guessing this is the case for most novice Python programmers. Many report having difficulty understanding generators and the yield keyword even after making a concerted effort to teach themselves the topic. Note: In recent years, generators have grown more powerful as features have been added through PEPs. Pylint - code analysis for Python. Your way out of The Lack of Testing Death Spiral - Pythoscope. Simeonfranklin.com - Understanding Python Decorators in 12 Easy Steps! Ok, perhaps I jest.

simeonfranklin.com - Understanding Python Decorators in 12 Easy Steps!

PyconSE 2015

Data analysis. Morberg. Note: Testar. Python by Alan Richmond. "Brackets" Review Blog. Welcome back for another weekly review series!

"Brackets" Review Blog

When you open first "Electronic Station" the first mission that you encounter is the classic "Brackets" mission. This is a simple, but interesting and useful mission. "Brackets" can be solved with a wide variety of methods, and CiO players have certainly come up with some clever and ingenious solutions to it. Description You are given an expression with numbers, brackets and operators.

Stack Solution. Python Tips, Tricks, and Hacks. 2.1. Process for Contributing Code — edX Developers Guide documentation. Open edX is a massive project, and we would love you to help us build the best online education system in the world – we can’t do it alone!

2.1. Process for Contributing Code — edX Developers Guide documentation

However, the core committers on the project are also developing features and creating pull requests, so we need to balance reviewing time with development time. To help manage our time and keep everyone as happy as possible, we’ve developed this document that explains what core committers and other contributors can expect from each other. The goals are: If you are a contributor submitting a pull request, expect that it will take a few weeks before it can be merged.

The earlier you can start talking with the rest of the Open edX community about the changes you want to make, before you even start changing code, the better the whole process will go. If you are a product owner, treat pull requests from contributors like feature requests from a customer. Fluent interface. A fluent interface is normally implemented by using method cascading (concretely method chaining) to relay the instruction context of a subsequent call (but a fluent interface entails more than just method chaining [1]).

Fluent interface

Generally, the context is defined through the return value of a called methodself-referential, where the new context is equivalent to the last contextterminated through the return of a void context. The first two points correspond to. Online Python Tutor - Learn programming by visualizing code execution. Welcome to Lark’s Tongue Guide to Python! - Lark's Tongue Guide to Python. ImportPython - Python Newsletter: Subscribe Python Weekly. DevDocs/Python. 5. Iterators & Generators — Python Practice Book.

What is a NoSQL Database? Learn By Writing One In Python. NoSQL is a term that has become ubiquitous in recent years.

What is a NoSQL Database? Learn By Writing One In Python

But what does "NoSQL" actually mean? How and why is it useful? In this article, we'll answer these questions by creating a toy NoSQL database in pure Python (or, as I like to call it, "slightly structured pseudo-code"). OldSQL To most, SQL is synonymous with "database". The word "Relational" in the acronym RDBMS is the most informative. Steve's Blog: Embedding python in bash scripts. As a software development consultant, I do a lot of bash scripting.

Steve's Blog: Embedding python in bash scripts

Simeonfranklin.com - Understanding Python Decorators in 12 Easy Steps! Why Every Language Needs Its Underscore - Hackflow. (This is an adaptation of a talk I gave at PyCon and DevDay.

Why Every Language Needs Its Underscore - Hackflow

Slides and video are available in russian) Do you know what underscore is? In its most general it’s a JavaScript library that makes life better. For whoever writes in JavaScript. The Tao of Programming. Translated by Geoffrey James Note: I copied this from and stripped out all of the IMHO extraneous formatting.

The Tao of Programming

---Alex The Silent Void Thus spake the Master Programmer: "When you have learned to snatch the error code from the trap frame, it will be time for you to leave. " Something mysterious is formed, born in the silent void. waiting alone and unmoving, it is at once still and yet in constant motion. If the Tao is great, then the operating system is great. The Tao of Programming flows far away and returns on the wind of morning. The Tao gave birth to machine language. The assembler gave birth to the compiler. Anti-Patterns in Python Programming - Constantine Lignos. This page is a collection of the most unfortunate but occasionally subtle issues I've seen in code written by students new to writing Python.

Anti-Patterns in Python Programming - Constantine Lignos

It's written to help students get past the phase of writing ugly Python code and understand some of the most common idioms. The simplifications employed (for example, ignoring generators and the power of itertools when talking about iteration) reflect its intended audience. There are always reasons to use some of these anti-patterns, which I've tried to give those where possible, but in general using these anti-patterns makes for less readable, more buggy, and less Pythonic code. Python code coverage analysis. Figleaf is a Python code coverage analysis tool, built somewhat on the model of Ned Batchelder's fantastic coverage module. The goals of figleaf are to be a minimal replacement of 'coverage.py' that supports more configurable coverage gathering and reporting. The main differences are: figleaf labels lines as "interesting", i.e. capable of being executed, if and only if Python will report their execution.

By contrast, 'coverage.py' reports on surrounding lines as well.Note that this means your "lines of code" count may be much lower with figleaf than with coverage.py...figleaf separates the reporting and the recording code completely; in particular, no path munging or anything else is done on the results of the trace function. This means that files may -- or may not -- be easier to find in figleaf; more is left up to your code, basically.This does make it a bit easier (IMO) to generate reports in other formats, combine reports, etc. Figleaf <program><options to program>

Full Stack Python.