hello world in flask the second thing is that we are going to return our data using the json formatwe therefore use the jsonify(function and pass it python dictionary structure with single key/value pair in this case the key is 'msgand the data associated with that key is 'hello flask worldthe jsonify(function will convert this python data structure into an equivalent json structure running the service we are now ready to run our application to do this we invoke the run(method of the flask application objectapp run(debug=trueoptionally this method has keyword parameter debug that can be set to trueif this is done then when the application is run some debugging information is generated that allows you to see what is happening this can be useful in development but would not typically be used in production the whole program is presented belowfrom flask import flaskjsonify app flask(__name__@app route('/hello'methods=['get']def welcome()return jsonify({'msg''hello flask world'}app run(debug=truewhen this program is run the initial output generated is as shown belowserving flask app "hello_flask_world(lazy loadingenvironmentproduction warningthis is development server do not use it in production deployment use production wsgi server instead debug modeon running on restarting with stat debugger is activedebugger pinof course we don' see any output from our own program yet this is because we have not invoked the welcome(function via the /hello url