【发布时间】:2019-05-14 09:59:08
【问题描述】:
我正在努力将一个列表从 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)
【问题讨论】:
-
也许是这个?
return template('Forum ID: {{ip_list}})'), ip_list=get_ip()) -
这段代码到底有什么问题?
-
@mkrieger1 它不打印函数get_ip()的内容
-
@mkrieger1 你试过我提出的解决方案了吗?