[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版
Although this covers most URLs you’re likely to encounter in the wild, the full format of URLs is slightly richer: protocol://ne ...
Why all the fuss about shorter URLs? Besides extending the life of your keyboard and eyesight, the main advantage of such minima ...
A First CGI Script The HTML file we saw in the prior section is just that—an HTML file, not a CGI script. When referenced by a b ...
statement generates an extra line feed in addition to the one that the print generates itself. The net effect is to insert a bla ...
modules and may need to be converted to the server platform’s text file format after being uploaded. Let’s look at each install ...
But because CGI scripts are run by the user “nobody,” PYTHONPATH may be arbitrary when a CGI script runs. Before you puzzle over ...
May require the special #!pythonpath line at the top for some servers Configure sys.path only if needed to see modules in other ...
full-blown Python installation on the server. The public domain PyInstaller and Py2Exe systems can produce a frozen Python binar ...
of CGI scripts, after all. Let’s start using this to better advantage now, and write a Python script that builds up response HTM ...
for loops to dynamically generate part of the HTML that is sent to the browser. Spe- cifically, it emits HTML to lay out a two-d ...
<table border=1> <tr> <td>0.0</td> <td>0.1</td> <td>0.2</td> <td>0.3</t ...
tutor3.html is a simple HTML file, not a CGI script (though its contents could be printed from a script as well). When this file ...
input type option values may transmit hidden data that embeds state information in pages (type=hidden), reinitializes fields (ty ...
through the script filename (and up to URL query parameters) are used in the conver- sation between browser and HTTP server, bef ...
Scripts should call cgi.FieldStorage only once and before accessing any field values. When it is called, we get back an object t ...
But there’s a catch here: where does the input field’s value come from if there is no form page? That is, if we type the CGI scr ...
URLs can become difficult for scripts that expect many complex parameters, other programs can automate the construction process. ...
for any URL address. When the URL names a simple HTML file, we simply download its contents. But when it names a CGI script, the ...
door to automated regression testing of CGI scripts—we can invoke scripts on any remote machine, and compare their reply text to ...
Example 15-9. PP4E\Internet\Web\tutor4.html <html> <title>CGI 101</title> <body> <H1>A second user ...
«
55
56
57
58
59
60
61
62
63
64
»
Free download pdf