对于字符串,它是输出
from bottle import route
@route('/')
def index():
return '4'
如果是int,则不输出
·为什么?
from bottle import route
@route('/')
def index():
return 4
环境
·Python 3.6
·bottel 0.13
·铬
答案 0 :(得分:0)
代码没有问题
from bottle import route
@route('/')
def index():
return '4'
@route('/')
def index2():
return 4
print("type of ", index()," is ", type(index()))
print("type of ", index2()," is ", type(index2()))
我得到了那个结果:
type of 4 is <class 'str'>
type of 4 is <class 'int'>