tldr – simplified man pages
Find man pages too verbose and all you want are some examples? Try tldr – I installed the python client in a virtualenv Tip: you can get git subcommands docs by putting in the “proper” binary, eg tldr find git-checkout
Find man pages too verbose and all you want are some examples? Try tldr – I installed the python client in a virtualenv Tip: you can get git subcommands docs by putting in the “proper” binary, eg tldr find git-checkout
My new current favourite theme for emacs is spolsky. If you use elpy / highlight-indentation, you might want to define this too: (set-face-background ‘highlight-indentation-face “#1B2025”)
I’ve used free Dynamic DNS services to give my home machine a “static” address in the past but they either start charging or have poor performance. As I run my own external nameserver, why not use RFC 2136 to dynamically update the address based on the IP from ipify? So with some python scripting, that’s …
Continue reading ‘Dynamic DNS updating in python with ipify’ »
One reason I like python is the functional aspects to it. Recently working on my command line email checker imapchkr I wanted to find out if any account object had a new mail count > 0. I had a list of these objects (which are actually namedtuples). This was neatly done with a list comprehension …
[cc lang=”python”] #!/usr/bin/env python # simple example of threading.Timer in python import time, threading class Counter(object): def __init__(self, initial = 0, update_interval = 5): self.counter = initial self.update_interval = update_interval def inc(self): self.counter += 1 # Timer only runs once so call recursively in inc() threading.Timer(self.update_interval, self.inc).start() a = Counter() b = Counter(50, 10) c …
Continue reading ‘Simple example of using the threading Timer class in python’ »