comparison 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
comparison
equal deleted inserted replaced
725:55a9ba575605 726:541560ed190f
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 """
5 find str format options
6 """
7
8 import argparse
9 import os
10 import subprocess
11 import sys
12
13 __all__ = ['main']
14
15 def find_keys(string):
16 retval = set()
17 while True:
18 try:
19 string.format(**{i:'' for i in retval})
20 return retval
21 except KeyError:
22 import pdb; pdb.set_trace()
23
24 def main(args=sys.argv[1:]):
25
26 # parse command line
27 string = ' '.join(args)
28
29 if __name__ == '__main__':
30 main()