Port of walletbackup.sh to Python.

nit: line 40 is not very pep8-friendly (even if spacing here is not explicitly defined in pep8). But flake8 or some other pep8-compatible linter isn't being used yet anyway, so you could probably get away this....