python |
These notes are my personal online notebook of useful commands and "how-to's". You are welcome to make use of them if you find them helpful. They obviously don't come with any warranty! Click on one of the category tags above for the notes in any category. |
|||
OptionParser is designed for a fixed set of options. But if the first argument is a command that can affect which options are available, then OptionParser can still be used with some clever coding. #!/usr/bin/env python # $Id: options.py 17 2013-11-07 03:43:22Z andrewfn $ """Demo of using OptionParser where the first argument is a command that can take variable options. The help system is totally automated and the framework is very easy to use.""" ver = 1.0 #put version number here use = {} #put the commands in here, with the integer giving the number of extra arguments |
|||
|
|||
Here are some misc scripts. |
|||
First it is necessary to create a backup user on the database which has (only) read access to everything. This is because its password will be embedded in the backup script which reduces security. This can be done with: |
|||
