Skip to content

Tag Archives: python

Fun with SchoolSpeak


So, our school has adopted SchoolSpeak as their online platform. This includes lunch orders, and I’ve been asked to help the administration out with some summary reports (at least until SchoolSpeak can directly support what we need). Basically, I need to figure out how much money was made each day of the month, totaled by […]

Making duplicity and ncftpput play nice with vsftpd FTP daemon


I’ve been setting up yet another remote backup lately (see associated problem here). For this purpose (on Unix), the duplicity solution looks ideal. However, I’ve tried it on a couple of lightweight FTP servers (a TL-WDR3600 and a Raspberry Pi) and neither of them work. I keep getting a “Permission Denied” message. I did quite […]

Python script for engineering format


[cce_python] # -*- coding: cp1252 -*- from math import tan, pi, sqrt, log, floor def eng(x, sigfigs=3): m = floor(log(x)/log(10)/3)*3 LUT = { -18: “a”, -15: “f”, -12: “p”, -9: “n”, -6: “ยต”, -3: “m”, 0: “”, 3: “k”, 6: “M”, 9: “G” } return (“{0:.{1}g}{2}”).format(x*10.0**(-m), sigfigs, LUT[m]) [/cce_python] I’m not sure what grief the […]

Python pretty print in hex


I recently needed to pretty print something from Python, but I needed the integers printed in hex rather than decimal. I overloaded the [cci lang="python"]PrettyPrinter[/cci] class to do it.