WHOA!  What is this file?  Is it meant to be run as a main program?  I certainly didn't think so before I saw this. Seems like your command-line switches are interesting enough to deserve real argparse support also.