~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-3.5.1-docs-html/library/html.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
 
 
4
 
 
5
 
<html xmlns="http://www.w3.org/1999/xhtml">
6
 
  <head>
7
 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
 
    
9
 
    <title>20.1. html — HyperText Markup Language support &mdash; Python 3.5.1 documentation</title>
10
 
    
11
 
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
12
 
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13
 
    
14
 
    <script type="text/javascript">
15
 
      var DOCUMENTATION_OPTIONS = {
16
 
        URL_ROOT:    '../',
17
 
        VERSION:     '3.5.1',
18
 
        COLLAPSE_INDEX: false,
19
 
        FILE_SUFFIX: '.html',
20
 
        HAS_SOURCE:  true
21
 
      };
22
 
    </script>
23
 
    <script type="text/javascript" src="../_static/jquery.js"></script>
24
 
    <script type="text/javascript" src="../_static/underscore.js"></script>
25
 
    <script type="text/javascript" src="../_static/doctools.js"></script>
26
 
    <script type="text/javascript" src="../_static/sidebar.js"></script>
27
 
    <link rel="search" type="application/opensearchdescription+xml"
28
 
          title="Search within Python 3.5.1 documentation"
29
 
          href="../_static/opensearch.xml"/>
30
 
    <link rel="author" title="About these documents" href="../about.html" />
31
 
    <link rel="copyright" title="Copyright" href="../copyright.html" />
32
 
    <link rel="top" title="Python 3.5.1 documentation" href="../contents.html" />
33
 
    <link rel="up" title="20. Structured Markup Processing Tools" href="markup.html" />
34
 
    <link rel="next" title="20.2. html.parser — Simple HTML and XHTML parser" href="html.parser.html" />
35
 
    <link rel="prev" title="20. Structured Markup Processing Tools" href="markup.html" />
36
 
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
37
 
    <script type="text/javascript" src="../_static/copybutton.js"></script>
38
 
    <script type="text/javascript" src="../_static/version_switch.js"></script>
39
 
    
40
 
 
41
 
 
42
 
  </head>
43
 
  <body role="document">  
44
 
    <div class="related" role="navigation" aria-label="related navigation">
45
 
      <h3>Navigation</h3>
46
 
      <ul>
47
 
        <li class="right" style="margin-right: 10px">
48
 
          <a href="../genindex.html" title="General Index"
49
 
             accesskey="I">index</a></li>
50
 
        <li class="right" >
51
 
          <a href="../py-modindex.html" title="Python Module Index"
52
 
             >modules</a> |</li>
53
 
        <li class="right" >
54
 
          <a href="html.parser.html" title="20.2. html.parser — Simple HTML and XHTML parser"
55
 
             accesskey="N">next</a> |</li>
56
 
        <li class="right" >
57
 
          <a href="markup.html" title="20. Structured Markup Processing Tools"
58
 
             accesskey="P">previous</a> |</li>
59
 
        <li><img src="../_static/py.png" alt=""
60
 
                 style="vertical-align: middle; margin-top: -1px"/></li>
61
 
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
62
 
        <li>
63
 
          <span class="version_switcher_placeholder">3.5.1</span>
64
 
          <a href="../index.html">Documentation </a> &raquo;
65
 
        </li>
66
 
 
67
 
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
68
 
          <li class="nav-item nav-item-2"><a href="markup.html" accesskey="U">20. Structured Markup Processing Tools</a> &raquo;</li> 
69
 
      </ul>
70
 
    </div>    
71
 
 
72
 
    <div class="document">
73
 
      <div class="documentwrapper">
74
 
        <div class="bodywrapper">
75
 
          <div class="body" role="main">
76
 
            
77
 
  <div class="section" id="module-html">
78
 
<span id="html-hypertext-markup-language-support"></span><h1>20.1. <a class="reference internal" href="#module-html" title="html: Helpers for manipulating HTML."><code class="xref py py-mod docutils literal"><span class="pre">html</span></code></a> &#8212; HyperText Markup Language support<a class="headerlink" href="#module-html" title="Permalink to this headline">¶</a></h1>
79
 
<p><strong>Source code:</strong> <a class="reference external" href="https://hg.python.org/cpython/file/3.5/Lib/html/__init__.py">Lib/html/__init__.py</a></p>
80
 
<hr class="docutils" />
81
 
<p>This module defines utilities to manipulate HTML.</p>
82
 
<dl class="function">
83
 
<dt id="html.escape">
84
 
<code class="descclassname">html.</code><code class="descname">escape</code><span class="sig-paren">(</span><em>s</em>, <em>quote=True</em><span class="sig-paren">)</span><a class="headerlink" href="#html.escape" title="Permalink to this definition">¶</a></dt>
85
 
<dd><p>Convert the characters <code class="docutils literal"><span class="pre">&amp;</span></code>, <code class="docutils literal"><span class="pre">&lt;</span></code> and <code class="docutils literal"><span class="pre">&gt;</span></code> in string <em>s</em> to HTML-safe
86
 
sequences.  Use this if you need to display text that might contain such
87
 
characters in HTML.  If the optional flag <em>quote</em> is true, the characters
88
 
(<code class="docutils literal"><span class="pre">&quot;</span></code>) and (<code class="docutils literal"><span class="pre">'</span></code>) are also translated; this helps for inclusion in an HTML
89
 
attribute value delimited by quotes, as in <code class="docutils literal"><span class="pre">&lt;a</span> <span class="pre">href=&quot;...&quot;&gt;</span></code>.</p>
90
 
<div class="versionadded">
91
 
<p><span class="versionmodified">New in version 3.2.</span></p>
92
 
</div>
93
 
</dd></dl>
94
 
 
95
 
<dl class="function">
96
 
<dt id="html.unescape">
97
 
<code class="descclassname">html.</code><code class="descname">unescape</code><span class="sig-paren">(</span><em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#html.unescape" title="Permalink to this definition">¶</a></dt>
98
 
<dd><p>Convert all named and numeric character references (e.g. <code class="docutils literal"><span class="pre">&amp;gt;</span></code>,
99
 
<code class="docutils literal"><span class="pre">&amp;#62;</span></code>, <code class="docutils literal"><span class="pre">&amp;x3e;</span></code>) in the string <em>s</em> to the corresponding unicode
100
 
characters.  This function uses the rules defined by the HTML 5 standard
101
 
for both valid and invalid character references, and the <a class="reference internal" href="html.entities.html#html.entities.html5" title="html.entities.html5"><code class="xref py py-data docutils literal"><span class="pre">list</span> <span class="pre">of</span>
102
 
<span class="pre">HTML</span> <span class="pre">5</span> <span class="pre">named</span> <span class="pre">character</span> <span class="pre">references</span></code></a>.</p>
103
 
<div class="versionadded">
104
 
<p><span class="versionmodified">New in version 3.4.</span></p>
105
 
</div>
106
 
</dd></dl>
107
 
 
108
 
<hr class="docutils" />
109
 
<p>Submodules in the <code class="docutils literal"><span class="pre">html</span></code> package are:</p>
110
 
<ul class="simple">
111
 
<li><a class="reference internal" href="html.parser.html#module-html.parser" title="html.parser: A simple parser that can handle HTML and XHTML."><code class="xref py py-mod docutils literal"><span class="pre">html.parser</span></code></a> &#8211; HTML/XHTML parser with lenient parsing mode</li>
112
 
<li><a class="reference internal" href="html.entities.html#module-html.entities" title="html.entities: Definitions of HTML general entities."><code class="xref py py-mod docutils literal"><span class="pre">html.entities</span></code></a> &#8211; HTML entity definitions</li>
113
 
</ul>
114
 
</div>
115
 
 
116
 
 
117
 
          </div>
118
 
        </div>
119
 
      </div>
120
 
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
121
 
        <div class="sphinxsidebarwrapper">
122
 
  <h4>Previous topic</h4>
123
 
  <p class="topless"><a href="markup.html"
124
 
                        title="previous chapter">20. Structured Markup Processing Tools</a></p>
125
 
  <h4>Next topic</h4>
126
 
  <p class="topless"><a href="html.parser.html"
127
 
                        title="next chapter">20.2. <code class="docutils literal"><span class="pre">html.parser</span></code> &#8212; Simple HTML and XHTML parser</a></p>
128
 
<h3>This Page</h3>
129
 
<ul class="this-page-menu">
130
 
  <li><a href="../bugs.html">Report a Bug</a></li>
131
 
  <li><a href="../_sources/library/html.txt"
132
 
         rel="nofollow">Show Source</a></li>
133
 
</ul>
134
 
 
135
 
<div id="searchbox" style="display: none" role="search">
136
 
  <h3>Quick search</h3>
137
 
    <form class="search" action="../search.html" method="get">
138
 
      <input type="text" name="q" />
139
 
      <input type="submit" value="Go" />
140
 
      <input type="hidden" name="check_keywords" value="yes" />
141
 
      <input type="hidden" name="area" value="default" />
142
 
    </form>
143
 
    <p class="searchtip" style="font-size: 90%">
144
 
    Enter search terms or a module, class or function name.
145
 
    </p>
146
 
</div>
147
 
<script type="text/javascript">$('#searchbox').show(0);</script>
148
 
        </div>
149
 
      </div>
150
 
      <div class="clearer"></div>
151
 
    </div>  
152
 
    <div class="related" role="navigation" aria-label="related navigation">
153
 
      <h3>Navigation</h3>
154
 
      <ul>
155
 
        <li class="right" style="margin-right: 10px">
156
 
          <a href="../genindex.html" title="General Index"
157
 
             >index</a></li>
158
 
        <li class="right" >
159
 
          <a href="../py-modindex.html" title="Python Module Index"
160
 
             >modules</a> |</li>
161
 
        <li class="right" >
162
 
          <a href="html.parser.html" title="20.2. html.parser — Simple HTML and XHTML parser"
163
 
             >next</a> |</li>
164
 
        <li class="right" >
165
 
          <a href="markup.html" title="20. Structured Markup Processing Tools"
166
 
             >previous</a> |</li>
167
 
        <li><img src="../_static/py.png" alt=""
168
 
                 style="vertical-align: middle; margin-top: -1px"/></li>
169
 
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
170
 
        <li>
171
 
          <span class="version_switcher_placeholder">3.5.1</span>
172
 
          <a href="../index.html">Documentation </a> &raquo;
173
 
        </li>
174
 
 
175
 
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
176
 
          <li class="nav-item nav-item-2"><a href="markup.html" >20. Structured Markup Processing Tools</a> &raquo;</li> 
177
 
      </ul>
178
 
    </div>  
179
 
    <div class="footer">
180
 
    &copy; <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
181
 
    <br />
182
 
    The Python Software Foundation is a non-profit corporation.
183
 
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
184
 
    <br />
185
 
    Last updated on Jan 22, 2016.
186
 
    <a href="../bugs.html">Found a bug</a>?
187
 
    <br />
188
 
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
189
 
    </div>
190
 
 
191
 
  </body>
192
 
</html>
 
 
b'\\ No newline at end of file'