Mercurial > hg > config
view python/find_str_format.py @ 726:541560ed190f
foo
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 02 Dec 2014 13:57:02 -0800 |
parents | |
children | 03b66f90916f |
line wrap: on
line source
#!/usr/bin/env python # -*- coding: utf-8 -*- """ find str format options """ import argparse import os import subprocess import sys __all__ = ['main'] def find_keys(string): retval = set() while True: try: string.format(**{i:'' for i in retval}) return retval except KeyError: import pdb; pdb.set_trace() def main(args=sys.argv[1:]): # parse command line string = ' '.join(args) if __name__ == '__main__': main()