我有两 (2) 个脚本,如下所示:
测试.py
from google.apputils import app
import gflags
FLAGS = gflags.FLAGS
gflags.DEFINE_string('flag1', 'Value 1', 'flag#1')
def main(argv):
FLAGS.flag1 = "Value2"
print 'Flag 1 has value: ' + FLAGS.flag1
if __name__ == '__main__':
app.run()
和test1.py
from google.apputils import app
import test
def main(argv):
print 'Flag 1 has value: ' + test.FLAGS.flag1
if __name__ == '__main__':
app.run()
如何将更改后的标志值从 test.py 传递到 test1.py,以便在 test1.py 中输出“标志 1 具有值:Value2”?