Creating a simple "Hello World" application using Flask in Pydroid 3:
1. Install Pydroid 3 from Play Store.
2. Open the app and locate the "Terminal Button" and tap it to open a dark phase side of the app. Then, write/code:
pip install flask
Wait for the installation process to complete.
3. Then, go back to the project side that is usually in the light phase and create a new file. Name the file as "app.py". In this file, write/code:
from flask import Flask
app = Flask(__name__)
@app.route("/") def hello(): return "Hello, World!"
if __name__ == "__main__": app.run(debug=True)
4. Save the changes and go to the terminal and write/code:
5. Run it by tapping the Enter Key of your keyboard and wait for it to load. A temporary local host; http://127.0.0.5000 will be generated. Tap the local host, you will be redirected to choose a browser. Choose and wait for it to load the "Hello World."
This is the simplest way to create/write "Hello World" with Python using Flask Framework on Smartphone.
To learn how to create a responsive website with your smartphone, click HERE.
I want to learnReplyDelete