yöntemini kullanarak Şişe ile bazı kodlama yaptım. Bu gerçekten basit ve ihtiyaçlarıma uyuyor. Bir sınıfa uygulamayı sarmak için çalıştım, ancak ben sopa var:Şişe çerçevesi ve OOP, işlev yerine
import bottle
app = bottle
class App():
def __init__(self,param):
self.param = param
# Doesn't work
@app.route("/1")
def index1(self):
return("I'm 1 | self.param = %s" % self.param)
# Doesn't work
@app.route("/2")
def index2(self):
return("I'm 2")
# Works fine
@app.route("/3")
def index3():
return("I'm 3")
o Şişe yöntemleri yerine işlevlerini kullanmak mümkün mü?
Neden bottleCBV https://github.com/techchunks/bottleCBV – Adeel