⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 183.html

📁 Python Ebook Python&XML
💻 HTML
字号:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Robots" content="INDEX,NOFOLLOW">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<TITLE>Safari | Python Developer's Handbook -&gt; The cgi Module</TITLE>
<LINK REL="stylesheet" HREF="oreillyi/oreillyN.css">
</HEAD>
<BODY bgcolor="white" text="black" link="#990000" vlink="#990000" alink="#990000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" cellpadding=5 cellspacing=0 border=0 class="navtopbg"><tr><td><font size="1"><p class="navtitle"><a href="8.html" class="navtitle">Web Development</a> &gt; <a href="0672319942.html" class="navtitle">Python Developer's Handbook</a> &gt; <a href="179.html" class="navtitle">12. Scripting Programming</a> &gt; <span class="nonavtitle">The cgi Module</span></p></font></td><td align="right" valign="top" nowrap><font size="1"><a href="main.asp?list" class="safnavoff">See All Titles</a></font></td></tr></table>
<TABLE width=100% bgcolor=white border=0 cellspacing=0 cellpadding=5><TR><TD>
<TABLE border=0 width="100%" cellspacing=0 cellpadding=0><TR><td align=left width="15%" class="headingsubbarbg"><a href="182.html" title="An Introduction to CGI"><font size="1">&lt;&nbsp;BACK</font></a></td><td align=center width="70%" class="headingsubbarbg"><font size="1"><a href="popanote.asp?pubui=oreilly&bookname=0672319942&snode=183" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="183.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="184.html" title="Creating, Installing, and Running Your Script"><font size="1">CONTINUE&nbsp;&gt;</font></a></td></TR></TABLE>
<a href="5%2F31%2F2002+4%3A44%3A47+PM.html" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><font color=white size=1>152015024128143245168232148039199167010047123209178152124239215162148040135189253149095235</font><a href="read3.asp?bookname=0672319942&snode=183&now=5%2F31%2F2002+4%3A44%3A47+PM" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><br>
<FONT>
				<h3>




The <tt cLASS="monofont">cgi</tt> Module</h3>
				<p>The <TT CLass="monofont">cgi</tT> module accepts <TT Class="monofont">sys.stdin</tt> and environment variables set by the server as
input sources. The output is sent directly to <tt class="monofont">sys.stdout,</tt> carrying an <tt claSs="monofont">HTTP</tT> header and the
data itself.</p>

				<p>A very simple <a Name="idx1073746617"></a>
					<A namE="idx1073746618"></A>header example would be</P>

				<Pre>
					
print "Content-type: text/html"
print

				</prE>

				<P>Note that it is necessary to have a new line at the end of the header information. In most cases, the previous line is all
you will use in your scripts.</P>

				<P>The <a namE="idx1073746619"></A>
					<A Name="idx1073746620"></a>
					<TT CLass="monofont">FieldStorage</tt> class, which is implemented by this module, is able to read both the standard input (for
<tt class="monofont">POST</tt> calls) and the query string (for <tt clasS="monofont">GET</tt> calls). In order to parse the contents of an HTML
Form, you need to create an instance of this class.</P>

				<p>This instance carries the following attributes:</p>

				<uL>
<li><p><a Name="idx1073746621"></A>
							<A NAme="idx1073746622"></a>
							<tT CLAss="monofont">fs.name

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -