from absl import app, flags, logging
import sys
#设置参数,第一个是参数名称,第二个是参数默认值,无默认值可取None,第三个是参数解释
flags.DEFINE_string(‘str_1’, ‘hello’, ‘Input a string.’)
flags.DEFINE_string(‘str_2’, ‘world’, ‘Input a string.’)
flags.DEFINE_integer(‘num_1’, 0, ‘Input a integer.’)
flags.DEFINE_integer(‘num_2’, 0, ‘Input a integer.’)
FLAGS = flags.FLAGS
def main(argv=()):
# del argv
# version = sys.version_info
# logging.info(‘Running under Python {0[0]}.{0[1]}.{0[2]}’.format(version))
str3 = FLAGS.str_1 + FLAGS.str_2
print(str3)
c = FLAGS.num_1 * FLAGS.num_2
print(c)