installation
To install Flask, you need to have Python 3 installed first. Once Python is installed, use Command Prompt to navigate to your Python/Scripts folder, then type:pip3 install flask
If you are running a Windows operating system, ignore the following advice:
On MAC (as of mid-2018) - running two simultaneous instances of IDLE takes some effort. For MAC only, I am using IDLE to serve web applications. To simulate a client on Mac, and to have a console window to print to for debugging purposes with your client (as your IDLE console window will be busy serving your web application), I would suggest installing Thonny. This way you can debug both server (via IDLE) and client (via Thonny) simulataneously. Run your web server via IDLE, and your client via Thonny. |
Another error you may encounter when running the server in IDLE is a
io.UnsupportedOperation: fileno
error:While the fileno() method works on normal IO objects (sys.stdout, sys.stderr, sys.stdin and socket.socket), the IDLE Python IDE changes your IO objects, which breaks this working. If you get this error, to fix it, launch the flask app using Python from the context menu (or command prompt) instead: