Python Icon

Python

Python is a dynamically typed programming language.
131 Stories
All Topics

Python github.com

Social Amnesia is the Men in Black's neuralyzer for your social media accounts

For many people, there is no reason they want to have years old tweets or reddit comments existing and making it easier for online marketers and jilted ex-lovers to profile you. Set the time period you want to keep, whitelist stuff you want to preserve indefinitely, and let Social Amnesia wipe the rest out of memory, MIB-style.

read more...

Command line interface github.com

Run SQL directly on CSV or TSV files

q is a command line tool that allows direct execution of SQL-like queries on CSVs/TSVs (and any other tabular text files). q treats ordinary files as database tables, and supports all SQL constructs, such as WHERE, GROUP BY, JOINs etc. It supports automatic column name and column type detection, and provides full support for multiple encodings. An example of using q to count distinct values of a specific field (uuid of clicks data) q -H -t "SELECT COUNT(DISTINCT(uuid)) FROM ./clicks.csv"

read more...

Claudio github.com

Pampy – pattern matching for Python

Pampy is pretty small (150 lines), reasonably fast, and often makes your code more readable, and easier to reason about. Pattern matching is the feature in Elixir that I miss when using other languages, so it’s awesome to see it brought to Python. Here’s an example of Pampy in action as a Lisp calculator (from the readme): from pampy import match, REST, _ def lisp(exp): return match(exp, int, lambda x: x, callable, lambda x: x, (callable, REST), lambda f, rest: f(*map(lisp, rest)), tuple, lambda t: list(map(lisp, t)), ) plus = lambda a, b: a + b minus = lambda a, b: a - b from functools import reduce lisp((plus, 1, 2)) # => 3 lisp((plus, 1, (minus, 4, 2))) # => 3 lisp((reduce, plus, (range, 10))) # => 45

read more...

Python github.com

An experimental code editor for writing algorithms

Algojammer is heavily inspired by (stolen from) the work of Bret Victor, particularly Learnable Programming (2012) and Inventing On Principle (2012), although it only incorporates some of the ideas presented. A longer list of other influences and similar projects is given in Inspiration. If you’ve never heard/seen Bret Victor’s work, do yourself a favor and click all of those links above.

read more...

 Itamar Turner-Trauring codewithoutrules.com

Stabbing yourself with a fork() in a multiprocessing.Pool full of sharks

I really dig Itamar’s writing style: It’s time for another deep-dive into Python brokenness and the pain that is POSIX system programming, this time with exciting and not very convincing shark-themed metaphors! There’s a lot to learn here, and it’s not all Python specific. Hop in, the water’s warm (but filled with sharks)!

read more...

Kenneth Reitz kennethreitz.org

Reasons to use VS Code for Python development

Kenneth Reitz, well known in the Python community, creator of Requests, and a former Changelogger has been using VS Code for Python development for several months and is giving it the “should use” status. Kenneth writes on his personal blog: I’ve been using Visual Studio Code daily now (for Python development) for about six months — long enough to give it a thorough review. Before, I was using Sublime Text with a few plugins, which worked very well— but, I am continually shocked at just how good VS Code is, in comparison, and I’d like to share with you my observations / opinions…

read more...

Steven Loria github.com

Configuration done right in Python

Steven Loria: Stop using unversioned settings files and start storing configuration in environment variables (see The Twelve-Factor App). environs makes it easy to parse environment variables with built-in type-casting and validation. It will even read .env files, which are handy for local development. 💯% agree with using environment variables for configuration. I used to do the .gitignore a Yaml file thang, but nowadays it’s all direnv and/or dotenv.

read more...

Python github.com

The Hitchiker's Guide to PyTorch

PyTorch is a flexible deep learning framework that allows automatic differentiation through dynamic neural networks (i.e., networks that utilise dynamic control flow like if statements and while loops). It supports GPU acceleration, distributed training, various optimisations, and plenty more neat features. These are some notes on how I think about using PyTorch, and don’t encompass all parts of the library or every best practice, but may be helpful to others.

read more...

Python mail.python.org

Guido van Rossum retires as Python's BDFL 😱

We were just discussing this on a recent episode, and now it’s a reality!? I’m basically giving myself a permanent vacation from being BDFL, and you all will be on your own. After all that’s eventually going to happen regardless – there’s still that bus lurking around the corner, and I’m not getting younger… (I’ll spare you the list of medical issues.) He will not appoint a successor. What happens next?! Not even Guido knows: So what are you all going to do? Create a democracy? Anarchy? A dictatorship? A federation? Grab some 🍿 because this is gonna get interesting!

read more...
0:00 / 0:00