old_contents: from flask import Flask
  from redis import Redis
  import os
  app = Flask(__name__)
  redis = Redis(host='redis', port=6379)
  
  @app.route('/')
  def hello():
      redis.incr('hits')
      return 'Hello World! I have been seen %s times.Env is: %s' % (redis.get('hits'), os.environ['MODE'])
  
  if __name__ == "__main__":
      app.run(host="0.0.0.0", debug=True)
new_contents: from flask import Flask
  from redis import Redis
  import os
  app = Flask(__name__)
  redis = Redis(host='redis', port=6379)
  
  @app.route('/')
  def hello():
      redis.incr('hits')
      return 'Hello World! I have been seen %s times.\n' % redis.get('hits')
  
  if __name__ == "__main__":
      app.run(host="0.0.0.0", debug=True)
subject: 格式化输出,解决错误