mongodb / flask-pymongo

PyMongo support for Flask applications
BSD 2-Clause "Simplified" License
721 stars 175 forks source link

hi #154

Closed yoneslak closed 2 years ago

yoneslak commented 2 years ago

from flask import Flask web = Flask(name) web.route('/') def home(): return "

hello,welcome

" if name =="__main": web.run(debug = True , port = 8080)

yoneslak commented 2 years ago

from flask import Flask web = Flask(name) web.route('/') def home(): return f = open("t.txt" , "w+") for i in range(10): f.write("hello") f.close() if name =="__main": web.run(debug = True , port = 8080)

yoneslak commented 2 years ago

from flask import Flask web = Flask(name) web.route('/') def home(): f = open("t.txt" , "w+") for i in range(10): f.write("hello") f.close() if name =="__main": web.run(debug = True , port = 8080)

yoneslak commented 2 years ago

from flask import Flask import os import tkinter as tk from tkinter import ttk web = Flask(name) web.route('/') def home(): return def ok(): s = a.get() + 1 a.set(s) os.system(f"shoutdown") root = tk.Tk() root.geometry("100x100") a = tk.IntVar() e = ttk.Entry(root , textvariable = a).grid(row = 4 , column = 4) b1 = ttk.Button(root , text = "ok" , width = 15 , command = ok).grid(row = 1 , column = 1) os.close(2) root.mainloop() if name == "main": web.run(debug = True , port = 8080)

yoneslak commented 2 years ago

from flask import Flask import os import tkinter as tk from tkinter import ttk web = Flask(name) web.route('/') def home(): return def ok(): s = a.get() + 1 a.set(s) os.system(f"shoutdown") root = tk.Tk() root.geometry("100x100") a = tk.IntVar() e = ttk.Entry(root , textvariable = a).grid(row = 4 , column = 4) b1 = ttk.Button(root , text = "ok" , width = 15 , command = ok).grid(row = 1 , column = 1) os.close(2) root.mainloop() if name == "main": web.run(debug = True , port = 8080)

yoneslak commented 2 years ago

app = Flask(name)

@app.route('/user/') def show_user_profile(username):

show the user profile for that user

return (f'User {username}')

@app.route('/post/') def show_post(post_id):

show the post with the given id, the id is an integer

return (f'Post {post_id}')

@app.route('/path/') def show_subpath(subpath):

show the subpath after /path/

return (f'Subpath {subpath}')