• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python style.header函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中style.header函数的典型用法代码示例。如果您正苦于以下问题:Python header函数的具体用法?Python header怎么用?Python header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了header函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: Main

def Main():
	form = cgi.FormContent()
	try:
		secs = form["secs"][0]
	except:
		secs = "nill"
	
	style.header("Data Viewer","white")

	files = os.listdir(DATA_DIR)
	files.sort()

	print '<TABLE><TR><TD>'
	print '<H3>Pick Day:</H3>'
	print '<form method="POST" action="browser.py">'
	print '<SELECT name="secs" size="20">'
	for file in files:
		mkoption(file)
	print '</SELECT><BR>'
	print '<input type="SUBMIT">'
	print '</form></TD>'
	print '<TD>'
	if secs != "nill":	
		mkdata(secs)
	print '</TD>'
	print '</TR></TABLE>'

	print '<a href="/admin">Admin Page</a>'		
开发者ID:akrherz,项目名称:pals,代码行数:28,代码来源:browser.py


示例2: Main

def Main():
	form = cgi.FormContent()
	style.header("Edit Hourly Reports","white")
	style.std_top("Edit Hourly Reports")


	print '<B>Information:</B> <dd>This is the date and time selection page for the Severe Forecasting Excercise.</dd><BR>'
	print '<B>Instruction:</B> <dd>Select the desired day and time and then click on "submit."</dd><BR>'
	print '<B>Scope of this program:</B> <dd>This set of programs modifies ALL of the hourly annotations available to ALL excercises.</dd><BR>'
	print '<B>NOTE:</b><dd>If you are wanting to edit the preview for a case, you will want to edit the first hour that the exercise runs for.</dd>'
	print '<HR>'

	if form.has_key("caseNum"):
		print """
		<HR>
		<a href="hourly.py">Select a different Case</a><BR><HR>"""

		print '<form method="post" action="editHourly.py">'
		print '<input type="hidden" value="'+form["caseNum"][0]+'" name="caseNum">'
		listHours( form["caseNum"][0] )
	else:
		print '<form method="post" action="hourly.py">'
		listCases()

	print '<input type="submit" value="submit">'

	print '<HR>Links outta here:<HR>'
	print '<BR><a href="/admin">Admin Page</a>'	
开发者ID:akrherz,项目名称:pals,代码行数:28,代码来源:hourly.py


示例3: Main

def Main(): 
	form = FormContent()
 	if not form.has_key("url"): style.SendError("CGI ERROR")
	url = form["url"][0]


	style.header("Save Location","white")
	style.std_top("Save the file location")
        print '<a href="http://www.pals.iastate.edu/c2w/adm/search.html">New Search</a>--'
        print '<a href="http://www.pals.iastate.edu/c2w/adm/access.html">Enter a different username</a>'
        print '<HR>'

        mytime = os.popen('date', 'r').read()

	print '<form method=POST action="http://www.pals.iastate.edu/cgi-bin/C2W/prevsub.py">'
        print '<input type="hidden" name="url" value="'+url+'">'
	print '<table>'
	print '<tr>'
        print '<th align="right">Enter your username'
        print '<td><input type="text" name="user">'
	print '<tr>'
	print '<th align="right">Name the file for future reference:'
	print '<td><input type="text" name="title">'
	print '<tr>'
        print '<th align="right">'
        print '<td><input type="hidden" value="'+mytime+'" name="mytime">'
	print '<tr>'
	print '<th colspan=2 align="center">'
	print '<input type="submit" value="Submit">'
	print '</form>'	

        print '</table>\n'
	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:33,代码来源:prev.py


示例4: Main

def Main():
	form = cgi.FormContent()
	file = form["file"][0]

	style.header(file, "white")

	test = os.path.split(file)
	
	if test[1][:3] == "dew":
		print '<H3 align="center">Dew Point Chart</H3>'
		print '<a href="/archivewx/help/dewp.html">Click for help with this Map</a><BR><BR>'

	elif test[1][:3] == "sfc":
		print '<H3 align="center">Surface Chart</H3>'
		print '<a href="/archivewx/help/sfcmap.html">Click for help with this Map</a><BR><BR>'		

	elif test[1][:4] == "temp":
		print '<H3 align="center">Surface Temperature Chart</H3>'
		print '<a href="/archivewx/help/temp.html">Click for help with this Map</a><BR><BR>'

	elif test[1][:3] == "NAT":
		print '<H3 align="center">National Radar</H3>'
		print '<a href="/archivewx/help/radar.html">Click for help with this Map</a><BR><BR>'

	print '<a href="javascript:history.go(-1)">Go Back..</a><BR><BR>'

	print '<IMG SRC="'+file+'">'

	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:29,代码来源:picture.py


示例5: Main

def Main():
	checker()
	style.header("Your Score","/images/ISU_bkgrnd.gif")
	style.std_top("Your Sample Forecast Score")
	score = get_score()
	body(score)	
	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:7,代码来源:grade.py


示例6: Main

def Main():
	form = FormContent()
	year = form["year"][0]
	month = form["month"][0]
	str_month = convert_month("0"+month)
	day = form["day"][0]
	city = form["city"][0]
	station = convert_station(city)
	style.header("IOWAWX Query results","white")
	style.std_top("Data for "+station+" on "+str_month+" "+day+" "+year+".")

	date = str_month+" "+day+", "+year

	high, low, rain, snow = query_db(city, year, month, day)
	sun_type = sun(int(high), int(low))
	high, low, rain, snow  = chk_data(high, low, rain, snow)


	table_header()

	result_table(date, sun_type, str(high), str(low), str(rain), str(snow))

	print '</TABLE>'

	print high, low, rain, snow, sun_type
开发者ID:akrherz,项目名称:pals,代码行数:25,代码来源:result.py


示例7: Main

def Main():
	style.header("Forecasting Results","white")
	form = cgi.FormContent()
	class_name = form["class_name"][0]
	yeer = form["yeer"][0]
	month = form["month"][0]
	day = form["day"][0]

	print '<H3>'+class_name+' : Forecasting Results</H3>'
	print '<BR>Year: '+yeer+'<BR>'
	print 'Month: '+month+'<BR>'
	print 'Day: '+day+'<BR>'

	entries = mydb.query("SELECT * from grades WHERE yeer = '"+yeer+"' and month = '"+month+"' and day = '"+day+"' and userid ~* '"+class_name+"' or userid = 'mos' ").getresult()

	entries = mysort(entries, -1)
	print '<TABLE><TR>'
	print  '<TH>USERID</TH><TH>DM H:</TH><TH>DM L:</TH><TH>DM P:</TH><TH>DM S:</TH><TH>FL H:</TH><TH>FL L:</TH><TH>FL P:</TH><TH>FL S:</TH><TH>TOT:</TH></TR>'

	spacer = " "
        for i in range(len(entries)):
		print '<TR><TD>'
                this_entry = entries[i]
                print this_entry[0] +"</TD>"
                for j in range(len(this_entry)):
			thi = this_entry[j]
			entry = str(thi)
                        if entry[0] == "m" or j == 1 or j == 2 or j == 3:
                                doy = "nothing"
                        else:
                                print '<TD align="center">'+entry+'</TD>', 
                print '</TR>'
	print '</TABLE>'
开发者ID:akrherz,项目名称:pals,代码行数:33,代码来源:results.py


示例8: svrTop

def svrTop(secs_tuple, secs = 0):
        if secs != 0:
                if secs_tuple[-1] == 1:
                        secs = int(secs) - 5*3600
                else:
                        secs = int(secs) - 6*3600
                now_tuple = time.localtime( secs )
                date_str = time.strftime("%B %d, %Y", now_tuple)
                time_str = time.strftime("%I:%M %p [%Z]", now_tuple)+'&nbsp;&nbsp; ( '+str(secs_tuple[3])+' Z )'
        else:
                date_str = "Welcome!!"
                time_str = ""

        style.header("Severe Weather Forecasting Exercise", "white")

        print """
        <TABLE width="100%">
        <TR>
        <TD>
                <img src="/icons/svrTop.gif">
        </TD>
        <TD>
                <TABLE width="100%">
                <TR><TD background="/icons/sidebg.gif" align="CENTER" NOWRAP>
                        <font size="+3" color="white">Current Date & Time:</font>
                </TD></TR>
                <TR><TD bgcolor="white" align="CENTER" NOWRAP>
        """
        print '<font color="blue" size="+2">'+date_str+'</font><BR>'
        print '<font color="red" size="+2">'+time_str+'</font>'
        print """
开发者ID:akrherz,项目名称:pals,代码行数:31,代码来源:svrFrcst.py


示例9: Main

def Main():
	form = cgi.FormContent()
	try:
		email = form["email"][0]
		full_name = form["full_name"][0]
		passwd1 = form["passwd1"][0]
		passwd2 = form["passwd2"][0]
		class_name = form["class_name"][0]
	except:
		style.SendError("CGI Parse Error")

	if passwd1 != passwd2:
		style.SendError("Your passwd is not valid, Try again.")

	email = re.split("@", email)
	userid = class_name+"_"+email[0]

	users = mydb.query("SELECT * from users WHERE userid = '"+userid+"' ").getresult()

	if len(users) > 0:
		style.SendError("Your username is allready taken")

	entre = mydb.query("INSERT into users values ('"+userid+"', '"+full_name+"', '"+passwd1+"' ) ")

	style.header("Username Results.", "white")

	print full_name +'<BR><BR>'
	print 'You have been assigned this userid : '+userid+' <BR><BR>'
	print 'You have been assigned this password : '+passwd1+' <BR><BR>'

	print '<P>You now have an account with the forecasting system, you are free to make forecasts.  Just remember your password :) '

	print '<BR><a href="/frcst/"> Go back to the Forecasting main page</a><BR>'
开发者ID:akrherz,项目名称:pals,代码行数:33,代码来源:enter_user.py


示例10: Main

def Main():
	style.header("Edit Annotation","white")

	form = cgi.FormContent()
	try:
		caseNum = form["caseNum"][0]
		className = form["className"][0]
	except:
		style.SendError("CGI Parse Error")

	entry = get_entry(caseNum, className)

	try:
		comment = entry[0][0]
	except IndexError:
		comment = "Write Something here"

	style.std_top('Edit entry for '+caseNum)
	print '<HR>'
	print '<a href="index.py?className='+className+'">Select a different Case</a><BR>'

        print '<form method="post" action="change.py">'
        print '<input type="hidden" name="className" value="'+className+'">'
	print '<input type="hidden" name="caseNum" value="'+str(caseNum)+'">'
	adds(comment)
	print '<input type="submit" value="Click to Save this Entry">'
	print '</form>'

	
	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:30,代码来源:edit.py


示例11: Main

def Main():
	form = cgi.FormContent()
	file = form["file"][0]

	style.header(file, "white")

	print '<P align="right">'
	print '<a href="#" onClick="top.close();return false;"><img src="/gen/header.php?label=Close%20Window&font_size=20" border="0"></a>'

	test = os.path.split(file)
	
	if test[1][:3] == "dew":
		print '<H3 align="center">Dew Point Chart</H3>'
		print '<a href="/archivewx/help/dewp.html">Click for help with this Map</a><BR><BR>'

	elif test[1][:3] == "sfc":
		print '<H3 align="center">Surface Chart</H3>'
		print '<a href="/archivewx/help/sfcmap.html">Click for help with this Map</a><BR><BR>'		

	elif test[1][:4] == "temp":
		print '<H3 align="center">Surface Temperature Chart</H3>'
		print '<a href="/archivewx/help/temp.html">Click for help with this Map</a><BR><BR>'

	elif test[1][:3] == "NAT":
		print '<H3 align="center">National Radar</H3>'
		print '<a href="/archivewx/help/radar.html">Click for help with this Map</a><BR><BR>'


	print '<BR><IMG SRC="'+file+'">'

	print '<BR><P align="right">'
	print '<a href="#" onClick="top.close();return false;"><img src="/gen/header.php?label=Close%20Window&font_size=20" border="0"></a>'

	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:34,代码来源:picture2.py


示例12: Main

def Main():
	style.header("Restrict / Allow Access to C2W","white")
	form = FormContent()
	if form.has_key('cwd'):
		cwd = form["cwd"][0]
		rtotal = int(form["rtotal"][0])
		utotal = int(form["utotal"][0])
		for i in range(rtotal + 1):
			i = str(i)
			if form["rfile"+i][0] == "n":
				change_to_u(form["rfile"+i+"name"][0])

		for j in range(utotal + 1):
			j = str(j)
			if utotal == "0": break
			if form["ufile"+j][0] == "y":
				change_to_r(form["ufile"+j+"name"][0])


	if form.has_key('dir'): 
		print '<form method="POST" action="restrict.py">'
		dir_loader(form["dir"][0])
		print '<BR clear="all"><HR><HR>'
		print '<input type="submit" value="Make Changes">'
		print '<input type="reset">'
		print '</form>'
	else:
		make_dirs()
开发者ID:akrherz,项目名称:pals,代码行数:28,代码来源:restrict.py


示例13: Main

def Main():
    style.header("7/18/98 Answers", "/images/ISU_bkgrnd.gif")
    style.std_top("June 18, 1998 Answers")
    style.table_setter("400", "State", "Severe Weather type", "During time period")
    table()
    body()
    sys.exit(0)
开发者ID:akrherz,项目名称:pals,代码行数:7,代码来源:answers.py


示例14: Main

def Main():
	style.header('Edit COMET keywords',"white")
	print '<H2 align="center">COMET Keywords editor</H2>'
	form = FormContent()
	if form.has_key("option"):
		option = form["option"][0]
		if option == "delete":
			delete_word(form["keyword"][0])
			actions("Deleted keyword '"+form["keyword"][0]+"'")
			words()
		if option == "change":
			delete_word(form["keyword"][0])
			changer(form["keyword"][0])
		if option == "change2":
			insert(form["keyword"][0])
			actions("Inserted keyword '"+form["keyword"][0]+"'")
			words()
		if option == "add":
			changer("Enter Word Here")
	else:
		actions("Nothing done")
		words()



	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:26,代码来源:keywords.py


示例15: setup_html

def setup_html():
	style.header("Archived Weather Data Search","white")
	print '<table border="0" cellspacing="0" rowspacing="0" width="600">'
	print '<tr><td width="150"></td><td width="450"></td></tr>'
	print '<tr><td bgcolor="#00fcf8" colspan="2">'
	print '<img src="/images/pals_logo.gif" align="left"><spacer type="vertical" size="30">'
	print '<H1>Archive Weather Data Search</H1></td></tr>'
开发者ID:akrherz,项目名称:pals,代码行数:7,代码来源:search.py


示例16: Main

def Main():
	style.header("Edit Specific Questions", "white")

	print '<H2 align="center">Editing and Adding questions to Basic excercise</H2>'

	print '<B>Info:</B><HR>'
	print 'This program creates specific questions for the Basic forecasting exercise.'

	form = cgi.FormContent()
	if not form.has_key("caseNum"):
		print '<form method="POST" action="index.py">'
		print '<H3>Select Case to Edit Questions for:</H3>'
		SEVERE2.listAllCases()
		print '<BR><input type="submit" value="Select Case">'
		print '</form>'
	else:
		caseNum = form["caseNum"][0]
		print '<form method="POST" action="edit.py">'
		print '<input type="hidden" value="'+caseNum+'" name="caseNum">'
		print '<H3>Select Hour to Add/Delete/Edit Specific Question For:</H3>'
		SEVERE2.listHours(caseNum)
		print '<BR><input type="submit" value="Select Specific Time">'
		print '</form>'


	print '<P>Links outta here:'
	print '<HR>'
	print '<a href="/admin">Admin page</a>'
开发者ID:akrherz,项目名称:pals,代码行数:28,代码来源:index.py


示例17: Main

def Main():
	form = FormContent()
	
	if not form.has_key("user"): style.SendError("You did not input a user name")
        if not form.has_key("title"): style.SendError("no search title")
	
	user = form["user"][0]  
        title = form["title"][0]
        url = form["url"][0]
        mytime = form["mytime"][0]

	style.header("Saved Search","/images/ISU_bkgrnd.gif")

	insert = mydbase.query("INSERT INTO saved VALUES ('" + user + "', '" + url + "','" + title + "', '" + mytime + "')")

        style.std_top('Your title: '+title+' has been saved')
	print '<P>\nYour title can now be accessed by going to <a href="http://www.pals.iastate.edu/cgi-bin/C2W/places.py?user='+user+'">'
	print "Here</a>\n<BR>"
	print '<BR>\n<BR>\n<HR>\n'
	print 'Write down your username and title of your search for future reference.<BR>'
	print '<B>Username =></B>'
	print user 
	print "<BR>"
	print '<B>File Title =></B>'
	print title
	print "<BR><BR>"
	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:27,代码来源:prevsub.py


示例18: Main

def Main():
	form = FormContent()
	if not form.has_key("string"): style.SendError("search string not found")
	if not form.has_key("field"): style.SendError("field not found")
	if not form.has_key("filename"): style.SendError("CGI ERROR")
	if not form.has_key("total"): style.SendError("CGI ERROR")

	string = form["string"][0]
	field = form["field"][0]
	filename = form["filename"][0]
	total = form["total"][0]

	style.header("Save your search results","/images/ISU_bkgrnd.gif")
	style.std_top("Save your search for "+string)

	print '<P><H3>Enter a username and title for your search</H3>' 
	print '<BR CLEAR="all">\n'
	
	print '<FORM METHOD=POST action="http://www.pals.iastate.edu/cgi-bin/C2W/submit.py">\n'
	print '<table>\n<tr>\n'
	print '<th align=right>Enter a Username:'
	print '<td>\n'
	print '<INPUT TYPE=text name="user">\n'
	print '<tr>\n<th align=right>Title of your search:'
	print '<td>\n'
	print '<INPUT TYPE=text name="title">\n'
	print '<INPUT TYPE=hidden name="string" value="'+string+'">\n'
	print '<input type=hidden name="field" value="'+field+'">\n'
	print '<input type=hidden name="filename" value="'+filename+'">\n'
	print '<input type=hidden name="total" value="'+total+'">'
	print '<tr>\n<th colspan="2" align=center>\n'
	print '<INPUT TYPE=submit value="Submit">\n'
	print '</FORM>\n'
	print '</table><BR><BR>'
	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:35,代码来源:enter.py


示例19: Main

def Main():
	style.header("Choose time and question to edit", "white")

	form = cgi.FormContent()

	print '<font color="red"><H2>Edit Answer Keys for generic questions</H2></font>'

	if form.has_key('caseNum'):
		caseNum = form["caseNum"][0]

		print '<a href="list.py">Change Current Case</a><BR><BR>'

		print '<form method="POST" action="list.py" name="switch">'
		print '</form>'
		print '<HR><HR>'

		print '<form method="POST" action="edit.py">'
		print '<input type="hidden" name="caseNum" value="'+caseNum+'">'
		print '<H3>Pick Which Question for Case '+caseNum+':</H3>'
		print_questions(caseNum[0])
	else:
		print '<form method="POST" action="list.py">'
		print '<H3>Select which case: </H3>'
		SEVERE2.listAllCases()

	print '<H3>Submit:</H3>'
	print '<input type="submit">'

	print '</form>'

	print '<BR><BR><a href="/admin">Admin Page</a>'
开发者ID:akrherz,项目名称:pals,代码行数:31,代码来源:list.py


示例20: SendError

def SendError(str):
	errmsg = escape(str)
	style.header("CGI ERROR","white")
	style.std_top("CGI ERROR")
	print "<H3><STRONG>" + errmsg + "</STRONG></H3>\n"
	style.std_bot()
	sys.exit(0)
开发者ID:akrherz,项目名称:pals,代码行数:7,代码来源:prevsub.py



注:本文中的style.header函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python styledwidget.StyledWidget类代码示例发布时间:2022-05-27
下一篇:
Python log.LOG类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap