Python

Python Tips: On Getting Started, Unit Testing and Code Coverage

Python Tips: On Getting Started, Unit Testing and Code Coverage

tl;dr Here is a collection of useful Python tips, a starter “Hello World” Python template for both web (using Flask) and stand-alone script. And additional tips in writing effective Python code, getting started, Unit Tests and using the Coverage tool to improve code. Photo by Fabian Grohs on Unsplash Getting Started - Introducing “Python Hello World” Template Sometimes when we need to get started in Python, we need an easy “Hello World” template that gets us started with all the basics including unit test and coverage reports.

uvloop - Python replacement for asyncio event loop

uvloop - Python replacement for asyncio event loop

<img src="/img/2016/09/python_logo.png" alt=""> uvloop is a fast, drop-in replacement of the built-in asyncio event loop. uvloop is implemented in Cython and uses libuv under the hood. Benefits: uvloop makes asyncio 2-4x faster. Cons: uvloop is available from PyPI but it requires Python 3.5. (The reason for this is asyncio was introduced in Python 3.4 and above.) Unless your project is based on Python 3.4+ - you may not be able to leverage this library.

Node.js, Python, C/C++, Ruby, PHP development from a tiny Linux embedded for about $10

<img src="/img/2016/10/onion_io.png" alt="onion_io"> Came across this tiny IoT embedded micro-controller/computer that runs BusyBox or FreeBSD Linux and can run code written in Node.js, Python, C/C++, Ruby and PHP all at a cost of $5 to $10 with WiFi, 2G/3G, Bluetooth, GPS add-ons for your cloud services. It also has enough GPIO pins to interface with external world and not to mention the I2C and I2S interfaces for talking to other devices and peripherals as well as interfacing for sounds (I2S).