You must be logged in to access this section.
Login/Sign upfrom flask import Flask
app = Flask(__name__)
@app.route("/mainpage")
def mainpage():
return "اولین صفحه ی من"
if __name__ == "__main__":
app.run()
You can use the Flasc in Python to display the sentence "My First Page" at the specified URL. See the following code:
from flask import Flask
app = Flask(__name__)
@app.route('/mainpage/')
def main_page():
return "اولین صفحهی من"
if __name__ == '__main__':
app.run(debug=True, host='127.0.0.1', port=8000)
This code sets up a local server that at the address127.0.0.1:8000/mainpage/Displays the sentence.
Submitting answers is currently unavailable.
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.