For installing Web server on the Raspberry Pi, First you have need to install Flask on the Raspberry Pi Following Command is used to Install Flask:
After Successfull installation, Write Following code in python file: