Skip to main content

Flask web applications


We can build complex web applications using Python. For that, we would need one of the third party Python web framework Flask.

e:\python>pip install flask

# flask
#web2.py
from flask import Flask
app=Flask(__name__)

@app.route("/")
def hello():
    return "Hello Chennai"


e:\python>set FLASK_APP=web2.py

to run the app server
e:\python>flask run

open browser and goto
http://127.0.0.1:5000/


Another example

#web4.py

from flask import Flask , render_template
app= Flask(__name__)

@app.route("/")
@app.route("/home")
def home():
    return render_template('home.html')

@app.route("/about")
def about():
    return render_template('about.html')

@app.route("/home2")
def home2():
    return render_template('home2.html')

@app.route("/isdeep")
def isdeep():
    return render_template('isdeep.html')

if __name__ == '__main__':
    app.debug=True
    app.run




Popular posts from this blog

Machine Learning in Healthcare

Hari Nair Hospitals are constantly trying to improve the quality of care they deliver.  Machine learning (ML)  is creating disruptive changes in the healthcare industry.  ML was first applied to tailoring antibiotic dosages for patients in the 1970s..  Python developers can build solutions that benefit human health and well-being. Python and its frameworks work on principles  agreed upon the HIPAA checklist. Some of the practical areas for ML are: Medical image processing and anomaly detection Managing Hospitals and Patient Care Diagnostics Disease Prognosis Prediction Natural Language Processing (NLP) for Administrative Tasks Patient Risk Identification Computer vision methods have long been employed to automatically analyze biomedical images. The recent advent of deep learning has replaced many other machine learning methods, since it avoids the creation of hand-engineering features;  removing a critical source of error from the pro...

AI in Banking and Financial institutions

Hari Nair WeChat is a Chinese social media and mobile payment app, released during the year 2011 - China’s billion-user messaging app ClearBank , an innovative clearing bank in the UK based entirely on the cloud and offering an open-standards connection API, are showing the way to a future of distributed, hyper-efficient core banking services - Banking as a service!. AI will make intelligent automation   to do away with competition from FinTech players.  AI will enable banks to leverage  Machine Learning  optimally to drive operational and cost efficiencies.  By adapting AI, Banking sector have already taken actions, unlocking significant opportunities . Cognitive technology with Artificial Intelligence (AI) brings the advantage of Digitization to Banks.   SBI launched SIA, an AI-powered chat assistant that addresses customer enquiries  with everyday banking tasks.  Eva (Electronic Virtual Assistant) has addressed over 2...

AI and the Insurance Industry

  Hari Nair Needing insurance is like needing a parachute. If it isn't there the first time, chances are you won't be needing it again. --Author unknown Building customer relationships and managing risks are key for Insurance companies. Insurance companies are making extensive use of AI  are reaping the benefits of increased customer satisfaction adding to their bottom line.  AI has the potential to transform the insurance experience for customers from frustrating and bureaucratic to something fast, on-demand, and more affordable. Tailor-made insurance products will attract more customers at fairer prices. If insurers apply AI tech to the mountain of data at their disposal, we will soon start to see more flexible insurance such as on-demand pay-as-you-go insurance, and premiums that automatically adjust in response to accidents, customer health, etc.   Insurers have yet to unlock the full potential of AI. Machine learning use cases in Insu...