如何将python-cgi输出分割成页面。 样品环结构:Python CGI:如何将大量输出分割成页面?
尽管1:
if x is true:
c.execute("select m from n where id=%s")
gene=c.fetchall()
print "%s", (gene),
else:
print "NA"
if y is true:
c.execute("select p from q where id=%s")
protein=c.fetchall()
print "%s", (protein),
else:
print "NA"
print "\n"
输出是数以百万计的线。我想将输出分解成页面,比如每页50行。我怎么做?我感谢您的帮助。谢谢。
我想,我不能修改该选择命令,因为我具有其中将一排打印出环路多个选择命令。你有链接到示例代码? – Sushil
你是否需要来自每个sql请求或所有数据响应的50行?如果你有多个sql,你可以像这样设置限制:Limit offset,round(50/number_of_sql_queries) –