Recent posts

Python: Scope

July 16, 2017 | 4 minute read

Scope is the term used to define the location(s) in which Python searches for a name to object mapping (e.g a variable). As described in this StackOverflow post, Python uses the LEGB Rule to locate a definition. LEGB stands for: L, Local — Names assigned in any way within a function (_def _or lambda_)), and not declared global in that funct...

Python: Everything is an Object & First Class Citizens

July 14, 2017 | 1 minute read

A lot of Python books often mention that “everything in Python is an object”, and “objects are first class citizens”, but they don’t always explain what that these things actually mean. Let’s try to fix that up now. Everything in Python is an Object Dive Into Python gives a great explanation: Different programming languages define “object” in...

Python: if name == “main

July 13, 2017 | 1 minute read

There are plenty of articles on the internet that attempt to explain what if name == “main“ is and what it does, but (in my humble opinion), the examples are too complex more often than not. With that in mind, this post is aimed at being the most simplest explanation on the planet! :) What does it do? This statement is used when you want your ...

Windows: Accessing Python & pip from anywhere

June 14, 2017 | less than 1 minute read

When you install Python on Windows, you may find that you cannot access it and/or pip from anywhere on the commandline. For example, you find that you need to navigate to C:\Python27\Scripts in order to use pip. To enable access to them from anywhere on the commandline, issue the following commands: setx path "%path%;C:\\Python27;" setx path "%...

Navigating InfluxDB CLI

June 13, 2017 | 1 minute read

I’ve demonstrated a few InfluxDB commands in my Getting to know InfluxDB and InfluxDB: Retention Policies & Shard Groups posts but though it would be a good idea to write a post completely dedicated to useful CLI commands - so here it is. SHOW DATABASES This command is self explanatory. It lists all of your InfluxDB databases: > SHOW D...