import tensorflow as tf
flags = tf.app.flags
flags.FLAGS._parse_flags()
print(("\n".join(flags.FLAGS.__dict__['__flags'].keys())))

import tensorflow as tf
flags = tf.app.flags
flags.FLAGS._parse_flags()
for key, value in flags.FLAGS.__dict__['__flags'].items():
    print(key, value)

Update 03-Default-values-of-tf-app-args.py