我正在努力将一个列表从python文件传递到我的瓶服务器。我把它们分成函数,这样当你调用它时,它们就应该被打印出来
这就是我目前的情况:
from bottle import route, run, template, request
import sys
sys.path.append("../python")
from connectedDevices import *
@route('/list')
def print_list():
# Functions taken from connectedDevices
get_ip()
get_mac()
return template('Forum ID: {{get_ip()}})'), get_ip()=forum_id)
run(host='localhost', port=8080)
我设法解决了这个问题,显然如果我使用输入文件中的函数,我不能独立调用变量,只能调用函数lot。我删除了它们,现在我可以调用列表并使用:
相关问题 更多 >
编程相关推荐