import web
urls = (
'/index', 'Index',
'/blog/\d+', 'Blog',
'/(.*)', 'Hello'
)
app = web.application(urls, globals())
class Index:
def GET(self):
return 'Index Method'
class Blog:
def GET(self):
return 'Blog Method'
class Hello:
def GET(self, name):
return 'Hello ' + name
urls = (
'/index', 'Index',
'/blog/\d+', 'Blog',
'/(.*)', 'Hello'
)
app = web.application(urls, globals())
class Index:
def GET(self):
return 'Index Method'
class Blog:
def GET(self):
return 'Blog Method'
class Hello:
def GET(self, name):
return 'Hello ' + name
<a href="javascript:void(0);" onclick='javascript:show_color("ll", "#f00")'>red</a>
<a href="javascript:void(0);" onclick='javascript:show_color("ll", "#0f0")'>green</a>
<a href="javascript:void(0);" onclick='javascript:show_color("ll", "#0f0")'>green</a>
2018-01-29
<a href="javascript:void(0);" onclick='javascript:show_text("ll", "My First JavaScript");'>My First JavaScript</a>
<a href="javascript:void(0);" onclick='javascript:show_text("ll", "Hello python")'>Hello python</a>
<a href="javascript:void(0);" onclick='javascript:show_text("ll", "Hello python")'>Hello python</a>
2018-01-29
<head>
<title>Hello</title>
<script>
function show_text(id, text){
document.getElementById(id).innerHTML = text;
}
function show_color(id, color){ document.getElementById(id).style.color = color;
}
</script>
<style>
#ll {width: 200px; font-size:40px;}
</style>
</head>
<title>Hello</title>
<script>
function show_text(id, text){
document.getElementById(id).innerHTML = text;
}
function show_color(id, color){ document.getElementById(id).style.color = color;
}
</script>
<style>
#ll {width: 200px; font-size:40px;}
</style>
</head>
2018-01-29
db=MySQLdb.connect(host="localhost",user='root',passwd='123456',db='test',port=3306,cursorclass=MySQLdb.cursors.DictCursor,charset="utf8")