I'm new with python and I want to make a browser controlled piece of software to run on my raspberry pi.
This is my Main() function, stripped from most of the code to focus on the problem:
def Main():
print "Starting Flaskserver"
app = Flask(__name__)
@app.route('/')
def root():
return render_template("test.html")
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80, debug=True)
if __name__ == '__main__':
Main()
If I run this script, I notice in the console the script runs twice (print "Starting flaskserver"):
Starting Flaskserver
* Running on http://0.0.0.0:80/
* Restarting with reloader
Starting Flaskserver
test.html contains just a title...
What am I doing wrong?
Greetings