使用Publisher Handler进行Python Web开发 [英] Python web development with Publisher Handler

查看:76
本文介绍了使用Publisher Handler进行Python Web开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下python代码不起作用.在浏览器中什么都没有显示.
我正在使用Python Publisher Handler进行Web开发

The below python code is not working. Nothing shows up in browser.
I am using Python Publisher Handler for web development

def loop():
	for i in range(10):
		print "<html> <body> %d </body></html>" % i


谁能告诉我如何在Web开发程序中使用python进行循环.
谢谢!


Can anyone tell me how to use python for loop in web developemt.
Thanx!!

推荐答案

谁能告诉我如何在Web开发程序中使用python进行循环
此处: Python-用于循环语句 [
Can anyone tell me how to use python for loop in web developemt
Here: Python - for Loop Statements[^]

Example:
#!/usr/bin/python

for letter in 'Python':     # First Example
   print 'Current Letter :', letter

fruits = ['banana', 'apple',  'mango']
for fruit in fruits:        # Second Example
   print 'Current fruit :', fruit

print "Good bye!"


这将产生以下结果:


This will produce following result:

Current Letter : P
Current Letter : y
Current Letter : t
Current Letter : h
Current Letter : o
Current Letter : n
Current fruit : banana
Current fruit : apple
Current fruit : mango
Good bye!


这篇关于使用Publisher Handler进行Python Web开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆