Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/bin/sh | |
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
set -e | |
# Must be a valid filename | |
NAME=foo | |
PIDFILE=/var/run/$NAME.pid | |
#This is the command to be run, give the full pathname | |
DAEMON=/usr/local/bin/bar |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!