My Python setup for 2020

My Python setup used to change a lot, as I would find ad-hoc solutions for my needs. These days I’ve settled on a Python setup that satisfies pretty much all of my different use cases and is easy to use. It is composed of these tools: Pyenv for Python versions Pyenv is nice in the sense that it makes it a breeze to try and use new Python versions that don’t come bundled with your OS. e.g. try out the Walrus operator and Python 3.8: ...

January 18, 2020 · Me

Designing Pythonic APIs

Learning from Kenneth Reitz’s Requests When writing a package (library), providing it with a good API, is almost as important as its functionality itself (well, at least if you want some adoption), but what makes a good API? In this post, I’ll try to provide some insights on that question by comparing Requests and Urllib (part of Python’s standard library) in a few typical HTTP usage scenarios and see why Requests has become the de facto standard among Python users. ...

August 5, 2016 · Me

Pycubator - Open Source Python Training

Preparing to teach my first Python class, I searched the web for teaching materials I can use and came up almost empty handed. There is a great variety of Python open books like Dive into Python and How to Think Like a Computer Scientist but they are all for autodidactic purposes and not for classroom teaching. Pycubator is my attempt at establishing an open source Python training slides and exercises that the community of Python teachers can use and hopefully contribute to. It utilize RevealJS to create stunning slides, that are actually written in Markdown and hence easy to use with source control, and the exercises uses and the exercises are actually Jupyter notebooks so students can run their code straight away. ...

December 12, 2015 · Me

Project-based learning

Context The Python course I’m instructing at Avratech (see earlier post and CNN story) is advancing and the students are already a month and a half into their group projects. This post is about my personal experience with shifting my class from teacher-led learning to project-based (learning), but first, have a look at the 5 beautiful projects they’re working on (you might want to use Google to translate the websites if your Hebrew reading skills aren’t in shape ☺): ...

September 23, 2015 · Me

Optimization Tale

I was asked to optimize our web API service. This was the first time I ever experienced anything of that sort so I was pretty excited about it. I read a lot of blog posts and Stack Overflow questions about optimization but still wasted some time on optimizing the wrong parts. Following is the lessons I learned, and some pitfalls that you can avoid on your next optimization task. Locust vs Jmeter The first you want to do when optimizing anything is to be able to measure it’s performance. I looked for a Python based (my favorite language) load testing solution and found Locust. Locust is a quick and easy package to run a threaded load testing programs with nothing but Python code. Everything was great until I sadly realized that Locust aggregates the results, meaning: I couldn’t get a raw CSV to store and analyze later on using graph tools of sorts. ...

August 29, 2015 · Me

Teaching Python to Haredim (and a CNN visit)

For the last couple of months I’ve been involved in a great project: getting Haredic (ultra-orthodox jews) man into the software world! Last week, we got an exciting visit from Oren Libermann, a CNN reporter, who published this nice story. My job in the training process is to teach them the Python programing language. Were doing a 3 month course, in which we go from learning the basic features of the language to writing a full blown (but small) software project. ...

July 10, 2015 · Me

Coroutines in Python

In the last Pyweb-IL meetup I gave a short introduction talk about coroutines and their usage in Python. It covers the basic concepts of coroutines and how they can be used in Python. Check it out!

May 10, 2015 · Me