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

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...

A quick introduction to AI and ML

Hari Nair Artificial intelligence (AI) is a branch of computer science. Its main goal is to create smart machines that can learn on their own and are capable of thinking like humans. The term 'artificial intelligence' commonly applies to devices or applications capable of carrying out specific tasks in human ways, by mimicking cognitive functions such as: • learning • reasoning • problem-solving • visual perception • language-understanding There are two main types of AI: Applied AI - is more common and includes systems designed to intelligently carry out a single task, example: move a driverless vehicle. This category is also known as 'weak' or 'narrow' AI. Generalized AI - is less common and includes systems or devices that can theoretically handle any task, as they carry enough intelligence to find solutions to unfamiliar problems. Generalized AI is also known as 'strong' AI. Examples of true strong AI don't curren...

Digital transformation in BFSI

Hari Nair It is not enough to just import technologies like AI, Block-chain or smartphones into existing financial services, says futurist and Fin-tech entrepreneur  --Brett King. The two biggest issues facing the majority of Bank customers today are service delays and poor quality of personalization. Now that we have chat-bots that have become more and more intelligent every year with conversational interface design, personal banking is significantly improved. AI is bringing upon a digital revolution to banking.  Fin-tech is an industry aiming to disrupt financial services using Artificial Intelligence.  By reducing waiting time, the bank can get-rid-of  long ques and help customers get personalized services quicker. AI has the potential to eliminate human error in banking procedures, allowing banks to better understand customer demands, make credit cards extinct, and influence the attraction of the unbanked to financial services. Fintech is ...