清风乐逍遥 2014-04-13 17:25
浏览 3833

webpy 'builtin_function_or_method' object is not iterable

我准备用webpy做一个网站,现在遇到这个困难,希望知道的帮忙一下,
我的网站结构:
mysite
--site_helper.py
--controllers/index.py
--templates/main/base.html
--templates/main/index.html

site_helper.py
#! /usr/bin/python
#-*- coding:utf-8 -*-
#Filename: site_helper.py

import sys
reload(sys)
sys.setdefaultencoding("utf-8")
"""这是网站的入口文件,用于调动controllers, modules, templates下的内容来服务"""
import web
urls = (
'/?', 'controllers.index.Index', #controllers/index.py
)

#加载render
render = web.template.render
main_render = render(loc='templates/main', base='base', globals=globals)

if name == '__main__':
app = web.application(urls, globals())
app.run()

templates/main/base.html
$def with(page)


title
<br> #menu{<br> width:200px;<br> float:right;<br> }<br>


$:page

templates/main/index.html
$def with(news)

test

news

$news

controllers/index.py
#! /usr/bin/python
#-*- coding:utf-8 -*-
#Filename: controllers/index.py

import sys

reload(sys)
sys.setdefaultencoding("utf-8")

import site_helper as sher
class Index():
def GET(self):
ss = 'hello news'
return sher.main_render.index(ss) #出错

在我标记出错的那行产生了错误,错误为:'builtin_function_or_method' object is not iterable

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
    • ¥15 乘性高斯噪声在深度学习网络中的应用
    • ¥15 运筹学排序问题中的在线排序
    • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛