Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pip install flask
- from flask import Flask
- app = Flask(__name__)
- # http://127.0.0.1:5000 /
- # http://www.eg.com /
- # http://www.eg.com/info /info
- # http://www.eg.com/admin /admin
- def readFile(fname):
- with open(fname,'r') as file:
- page = file.read()
- return page
- @app.route('/')
- def homepage():
- return readFile('home.html')
- @app.route('/info')
- def info():
- return readFile('info.html')
- @app.route('/lib')
- def lib():
- return readFile('lib.html')
- if __name__ == '__main__':
- app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement