~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-2.7.11-docs-html/library/whichdb.html

  • Committer: Dave Kuhlman
  • Date: 2016-02-11 21:17:09 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20160211211709-03yaen3cjempbi2m
Updated Python 2.7 docs; added Python 3.5 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>11.7. whichdb — Guess which DBM module created a database &mdash; Python 2.7.11 documentation</title>
 
10
    
 
11
    <link rel="stylesheet" href="../_static/classic.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:     '2.7.11',
 
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 2.7.11 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 2.7.11 documentation" href="../contents.html" />
 
33
    <link rel="up" title="11. Data Persistence" href="persistence.html" />
 
34
    <link rel="next" title="11.8. dbm — Simple “database” interface" href="dbm.html" />
 
35
    <link rel="prev" title="11.6. anydbm — Generic access to DBM-style databases" href="anydbm.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="dbm.html" title="11.8. dbm — Simple “database” interface"
 
55
             accesskey="N">next</a> |</li>
 
56
        <li class="right" >
 
57
          <a href="anydbm.html" title="11.6. anydbm — Generic access to DBM-style databases"
 
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">2.7.11</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="persistence.html" accesskey="U">11. Data Persistence</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-whichdb">
 
78
<span id="whichdb-guess-which-dbm-module-created-a-database"></span><h1>11.7. <a class="reference internal" href="#module-whichdb" title="whichdb: Guess which DBM-style module created a given database."><code class="xref py py-mod docutils literal"><span class="pre">whichdb</span></code></a> &#8212; Guess which DBM module created a database<a class="headerlink" href="#module-whichdb" title="Permalink to this headline">¶</a></h1>
 
79
<div class="admonition note">
 
80
<p class="first admonition-title">Note</p>
 
81
<p class="last">The <a class="reference internal" href="#module-whichdb" title="whichdb: Guess which DBM-style module created a given database."><code class="xref py py-mod docutils literal"><span class="pre">whichdb</span></code></a> module&#8217;s only function has been put into the <a class="reference internal" href="dbm.html#module-dbm" title="dbm: The standard &quot;database&quot; interface, based on ndbm. (Unix)"><code class="xref py py-mod docutils literal"><span class="pre">dbm</span></code></a>
 
82
module in Python 3.  The <a class="reference internal" href="../glossary.html#term-2to3"><span class="xref std std-term">2to3</span></a> tool will automatically adapt imports
 
83
when converting your sources to Python 3.</p>
 
84
</div>
 
85
<p>The single function in this module attempts to guess which of the several simple
 
86
database modules available&#8211;<a class="reference internal" href="dbm.html#module-dbm" title="dbm: The standard &quot;database&quot; interface, based on ndbm. (Unix)"><code class="xref py py-mod docutils literal"><span class="pre">dbm</span></code></a>, <a class="reference internal" href="gdbm.html#module-gdbm" title="gdbm: GNU's reinterpretation of dbm. (Unix)"><code class="xref py py-mod docutils literal"><span class="pre">gdbm</span></code></a>, or <a class="reference internal" href="dbhash.html#module-dbhash" title="dbhash: DBM-style interface to the BSD database library."><code class="xref py py-mod docutils literal"><span class="pre">dbhash</span></code></a>&#8211;should be used to open a given file.</p>
 
87
<dl class="function">
 
88
<dt id="whichdb.whichdb">
 
89
<code class="descclassname">whichdb.</code><code class="descname">whichdb</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#whichdb.whichdb" title="Permalink to this definition">¶</a></dt>
 
90
<dd><p>Returns one of the following values: <code class="docutils literal"><span class="pre">None</span></code> if the file can&#8217;t be opened
 
91
because it&#8217;s unreadable or doesn&#8217;t exist; the empty string (<code class="docutils literal"><span class="pre">''</span></code>) if the
 
92
file&#8217;s format can&#8217;t be guessed; or a string containing the required module name,
 
93
such as <code class="docutils literal"><span class="pre">'dbm'</span></code> or <code class="docutils literal"><span class="pre">'gdbm'</span></code>.</p>
 
94
</dd></dl>
 
95
 
 
96
</div>
 
97
 
 
98
 
 
99
          </div>
 
100
        </div>
 
101
      </div>
 
102
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
 
103
        <div class="sphinxsidebarwrapper">
 
104
  <h4>Previous topic</h4>
 
105
  <p class="topless"><a href="anydbm.html"
 
106
                        title="previous chapter">11.6. <code class="docutils literal"><span class="pre">anydbm</span></code> &#8212; Generic access to DBM-style databases</a></p>
 
107
  <h4>Next topic</h4>
 
108
  <p class="topless"><a href="dbm.html"
 
109
                        title="next chapter">11.8. <code class="docutils literal"><span class="pre">dbm</span></code> &#8212; Simple &#8220;database&#8221; interface</a></p>
 
110
<h3>This Page</h3>
 
111
<ul class="this-page-menu">
 
112
  <li><a href="../bugs.html">Report a Bug</a></li>
 
113
  <li><a href="../_sources/library/whichdb.txt"
 
114
         rel="nofollow">Show Source</a></li>
 
115
</ul>
 
116
 
 
117
<div id="searchbox" style="display: none" role="search">
 
118
  <h3>Quick search</h3>
 
119
    <form class="search" action="../search.html" method="get">
 
120
      <input type="text" name="q" />
 
121
      <input type="submit" value="Go" />
 
122
      <input type="hidden" name="check_keywords" value="yes" />
 
123
      <input type="hidden" name="area" value="default" />
 
124
    </form>
 
125
    <p class="searchtip" style="font-size: 90%">
 
126
    Enter search terms or a module, class or function name.
 
127
    </p>
 
128
</div>
 
129
<script type="text/javascript">$('#searchbox').show(0);</script>
 
130
        </div>
 
131
      </div>
 
132
      <div class="clearer"></div>
 
133
    </div>  
 
134
    <div class="related" role="navigation" aria-label="related navigation">
 
135
      <h3>Navigation</h3>
 
136
      <ul>
 
137
        <li class="right" style="margin-right: 10px">
 
138
          <a href="../genindex.html" title="General Index"
 
139
             >index</a></li>
 
140
        <li class="right" >
 
141
          <a href="../py-modindex.html" title="Python Module Index"
 
142
             >modules</a> |</li>
 
143
        <li class="right" >
 
144
          <a href="dbm.html" title="11.8. dbm — Simple “database” interface"
 
145
             >next</a> |</li>
 
146
        <li class="right" >
 
147
          <a href="anydbm.html" title="11.6. anydbm — Generic access to DBM-style databases"
 
148
             >previous</a> |</li>
 
149
        <li><img src="../_static/py.png" alt=""
 
150
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
151
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
152
        <li>
 
153
          <span class="version_switcher_placeholder">2.7.11</span>
 
154
          <a href="../index.html">Documentation</a> &raquo;
 
155
        </li>
 
156
 
 
157
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
 
158
          <li class="nav-item nav-item-2"><a href="persistence.html" >11. Data Persistence</a> &raquo;</li> 
 
159
      </ul>
 
160
    </div>  
 
161
    <div class="footer">
 
162
    &copy; <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
 
163
    <br />
 
164
    The Python Software Foundation is a non-profit corporation.
 
165
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
 
166
    <br />
 
167
    Last updated on Jan 23, 2016.
 
168
    <a href="../bugs.html">Found a bug</a>?
 
169
    <br />
 
170
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
 
171
    </div>
 
172
 
 
173
  </body>
 
174
</html>
 
 
b'\\ No newline at end of file'