title: Syntax error in Python Flask
body: <p>I have the following code. When I run it, i get the following error:</p>
  
  <pre><code>File "app.py", line 16
      @app.route('/')
      ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>When I remove these lines</p>
  
  <pre><code>try:
      tree = ET.parse('export.xml')
      root = tree.getroot()
  </code></pre>
  
  <p>I do not have the error anymore. I don't understand what is the problem and how can I fix it.</p>
  
  <pre><code>from flask import Flask, render_template
  import xml.etree.ElementTree as ET
  import requests
  import json
  
  app = Flask(__name__)
  
  file = open("/home/ubuntu/flaskapp/export.xml", 'w')
  file.write(r.text)
  file.close()
  
  try:
      tree = ET.parse('export.xml')
      root = tree.getroot()
  
  @app.route('/')
  def hello_world():
      return 'Hello from Flask!'
  
  
  if __name__ == "__main__":
      app.run()
  </code></pre>