Using one bpython with multiple virtual environments
I finally realized that I should change the default Python REPL. There are many REPLs that offer a much better experience—ipython, bpython, and ptpython are probably the most well-known. In the past, I used ipython because I worked on many projects that involved Jupyter notebooks, so it came essentially for free whenever I installed the necessary packages.
However, in recent years, I’ve been working on a lot of projects that don’t rely on Jupyter, meaning ipython wasn’t installed by default. This meant I always had to manually install it in any virtual environment where I wanted to use it—which I didn’t like, as I prefer to keep only project-specific dependencies in a virtual environment.
…Run Jupyter Notebooks as a Service on macOS
I was looking for a way to run jupyer notebook without using a constantly open terminal or a screen session. On macOS there is a way to create services using a .plist file and the launchctl command.
Because I use different environments for all Python related stuff, it wasn’t immediately clear to me how to do this when I’ve installed Jupyter only in a pyenv. After some fiddling around, I finally solved it. The key was to set the working directory parameter to the directory in which the environment is loaded. In my case this is ~/notebooks
where I automatically load the env by using a .python-version
file.
QuickFolders – a BitBar plugin
I’m a big fan of BitBar, an application that allows you to “Put anything in your Mac OS X menu bar” (macOS nowadays). People have already created more than 250 plugins which allow you to show plenty of information in the menubar. Basically any script that can be executed on the terminal and has some kind of output can be used to display this output.
…Show Download and Upload speed on your LaMetric Time
Following a request at the LaMetric forum I wrote a small Python script for displaying your current download and upload speed on a LaMetric Time. The script can run on your own laptop or server (preferred).
Basically you need to do two things:
- Create an app for the LaMetric Time
- run the script that performs the speed test and push the results to the device
1. Create an indicator app
This is quite an easy thing to do. You need an account for the LaMetric developer area (it’s free, so don’t worry). In the developer area you can create a new app – in this case select indicator application.
…LaMetric Firmware 1.7.5
A new firmware for the LaMetric Time is out – version 1.7.5 has some nice things to offer for those of us who would like to use the device in home automation (sadly the documentation is not yet updated). While this has been announced in the change log for 1.7.4, there have been some bugs and there are still one or two things that needs fixing, but that’s just minor stuff.
…