{"@attributes":{"version":"2.0"},"channel":{"title":"Python on noamelf","link":"https:\/\/noamelf.com\/tags\/python\/","description":"Recent content in Python on noamelf","generator":"Hugo -- 0.137.1","language":"en","lastBuildDate":"Sat, 18 Jan 2020 00:00:00 +0000","item":[{"title":"My Python setup for 2020","link":"https:\/\/noamelf.com\/posts\/my-python-setup-for-2020\/","pubDate":"Sat, 18 Jan 2020 00:00:00 +0000","guid":"https:\/\/noamelf.com\/posts\/my-python-setup-for-2020\/","description":"<p>My Python setup used to change a lot, as I would find ad-hoc solutions for my needs. These days I&rsquo;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:<\/p>\n<h3 id=\"pyenv-for-python-versions\">Pyenv for Python versions<\/h3>\n<p><a href=\"https:\/\/github.com\/pyenv\/pyenv\">Pyenv<\/a> is nice in the sense that it makes it a breeze to try and use new Python versions that don&rsquo;t come bundled with your OS. e.g. try out the <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0572\/\">Walrus operator<\/a> and Python 3.8:<\/p>"},{"title":"Designing Pythonic APIs","link":"https:\/\/noamelf.com\/posts\/designing-pythonic-apis\/","pubDate":"Fri, 05 Aug 2016 00:00:00 +0000","guid":"https:\/\/noamelf.com\/posts\/designing-pythonic-apis\/","description":"<p><em>Learning from Kenneth Reitz&rsquo;s <a href=\"http:\/\/docs.python-requests.org\/en\/master\/\">Requests<\/a><\/em><\/p>\n<p>When writing a package (library), providing it with a good API, is almost as important as its\nfunctionality itself (well, at least if you want some adoption), but what makes a good API? In this post, I&rsquo;ll try to provide some insights on that question by comparing <em>Requests<\/em> and <em>Urllib<\/em> (part of Python&rsquo;s standard library) in a few typical HTTP usage scenarios and see why <em>Requests<\/em> has become the de facto standard among Python users.<\/p>"},{"title":"Pycubator - Open Source Python Training","link":"https:\/\/noamelf.com\/posts\/pycubator-open-source-python-training\/","pubDate":"Sat, 12 Dec 2015 17:35:04 +0000","guid":"https:\/\/noamelf.com\/posts\/pycubator-open-source-python-training\/","description":"<p>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 <a href=\"http:\/\/www.diveintopython.net\/\">Dive into Python<\/a> and <a href=\"http:\/\/www.openbookproject.net\/thinkcs\/python\/english2e\/\">How to Think Like a Computer Scientist<\/a> but they are all for autodidactic purposes and not for classroom teaching.<\/p>\n<p>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 <a href=\"https:\/\/github.com\/hakimel\/reveal.js\/\">RevealJS<\/a> 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 <a href=\"http:\/\/jupyter.org\/\">Jupyter notebooks<\/a> so students can run their code straight away.<\/p>"},{"title":"Project-based learning","link":"https:\/\/noamelf.com\/posts\/project-based-learning\/","pubDate":"Wed, 23 Sep 2015 17:29:00 +0000","guid":"https:\/\/noamelf.com\/posts\/project-based-learning\/","description":"<h4 id=\"context\">Context<\/h4>\n<p>The <a href=\"https:\/\/en.wikipedia.org\/wiki\/Python_%28programming_language%29\">Python<\/a> course I&rsquo;m instructing at Avratech (see <a href=\"http:\/\/thespoon.ghost.io\/ravtech-and-cnn\/\">earlier post<\/a> and <a href=\"http:\/\/edition.cnn.com\/2015\/07\/08\/world\/israel-ultra-orthodox-jews-high-tech\/index.html#\">CNN story<\/a>) 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 <em>teacher-led<\/em> learning to <em>project-based<\/em> (learning), but first, have a look at the 5 beautiful projects they&rsquo;re working on (you might want to use <a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;sl=iw&amp;tl=en&amp;u=jewishtimes.avratech.co.il\">Google to translate<\/a> the websites if your Hebrew reading skills aren&rsquo;t in shape \u263a):<\/p>"},{"title":"Optimization Tale","link":"https:\/\/noamelf.com\/posts\/optimization-tale\/","pubDate":"Sat, 29 Aug 2015 16:38:46 +0000","guid":"https:\/\/noamelf.com\/posts\/optimization-tale\/","description":"<p>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.<\/p>\n<h4 id=\"locust-vs-jmeter\">Locust vs Jmeter<\/h4>\n<p>The first you want to do when optimizing anything is to be able to measure it&rsquo;s performance. I looked for a Python based (my favorite language) load testing solution and found <a href=\"http:\/\/locust.io\/\">Locust<\/a>. 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&rsquo;t get a <em>raw<\/em> CSV to store and analyze later on using graph tools of sorts.<\/p>"},{"title":"Teaching Python to Haredim (and a CNN visit)","link":"https:\/\/noamelf.com\/posts\/ravtech-and-cnn\/","pubDate":"Fri, 10 Jul 2015 14:13:48 +0000","guid":"https:\/\/noamelf.com\/posts\/ravtech-and-cnn\/","description":"<p>For the last couple of months I&rsquo;ve been involved in a great project: getting <a href=\"https:\/\/en.wikipedia.org\/wiki\/Haredi_Judaism\">Haredic<\/a> (ultra-orthodox jews) man into the software world!<\/p>\n<p>Last week, we got an exciting visit from Oren Libermann, a CNN reporter, who published this nice <a href=\"http:\/\/edition.cnn.com\/2015\/07\/08\/world\/israel-ultra-orthodox-jews-high-tech\/index.html#\">story<\/a>.<\/p>\n<p>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.<\/p>"},{"title":"Coroutines in Python","link":"https:\/\/noamelf.com\/posts\/coroutines-in-python\/","pubDate":"Sun, 10 May 2015 12:16:55 +0000","guid":"https:\/\/noamelf.com\/posts\/coroutines-in-python\/","description":"<p>In the last <a href=\"http:\/\/www.meetup.com\/PyWeb-IL\/\">Pyweb-IL<\/a> meetup I gave a short introduction talk\nabout coroutines and their usage in Python. It covers the basic concepts of coroutines and how they\ncan be used in Python.<\/p>\n<p><a href=\"https:\/\/noamelf.com\/intro-to-python-coroutines-talk\">Check it out!<\/a><\/p>"}]}}