A program is a set of instructions to the computer by using different programming languages to perform a set of jobs. This programming language generally contains words and phrases from English languages. A program written in human-readable form can be called source code which then needs to be converted to machine code to perform the task by the Computer and this conversion is made by Interpreters and Compilers. Compiler and Python Interpreter? A compiler is a special program that translates a programming language's source code into machine code whole at once unlike the interpreter. A piece of software to run a Python code is called a Python interpreter. The interpreter is a layer of software that works between your program and your computer hardware to get your code running. Python codes are first compiled (translates) into equivalent byte code then the installed Python interpreter converts the python byte code into machine-executable code. What is Machine code? Machine code...
What is Flask? Flask is a micro web framework written in Python. It provides you with tools, libraries and technologies that allow you to build a web application. To learn more on Flask jump into this official doc. Flask App The idea is to create a simple Flask application that exposes multiple rest endpoints and dockerize it. Directory Structure We all need is a python file, a requirement file that install the Flask library and a Dockerfile for building image. ├── app.py ├── Dockerfile └── requirements.txt $ cat app.py from flask import Flask app = Flask(__name__) @app.route('/') def webapp(): return 'Hello world!' @app.route('/version') def webapp_version(): return 'Version: v1' @app.route('/desc') def webapp_desc(): return 'A simple web app developed for demo purpose' if __name__ == "__main__": app.run(debug=True) $ cat requirements.txt ...