📄 module-nis.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>8.16 nis -- Interface to Sun's NIS (Yellow Pages)</title>
<META NAME="description" CONTENT="8.16 nis -- Interface to Sun's NIS (Yellow Pages)">
<META NAME="keywords" CONTENT="lib">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" href="lib.css" tppabs="http://www.python.org/doc/current/lib/lib.css">
<LINK REL="next" href="module-syslog.html" tppabs="http://www.python.org/doc/current/lib/module-syslog.html">
<LINK REL="previous" href="module-resource.html" tppabs="http://www.python.org/doc/current/lib/module-resource.html">
<LINK REL="up" href="unix.html" tppabs="http://www.python.org/doc/current/lib/unix.html">
<LINK REL="next" href="module-syslog.html" tppabs="http://www.python.org/doc/current/lib/module-syslog.html">
</head>
<body>
<DIV CLASS="navigation"><table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A HREF="node216.html" tppabs="http://www.python.org/doc/current/lib/node216.html"><img src="previous.gif" tppabs="http://www.python.org/doc/current/icons/previous.gif" border="0" height="32"
alt="Previous Page" width="32"></A></td>
<td><A href="unix.html" tppabs="http://www.python.org/doc/current/lib/unix.html"><img src="up.gif" tppabs="http://www.python.org/doc/current/icons/up.gif" border="0" height="32"
alt="Up One Level" width="32"></A></td>
<td><A href="module-syslog.html" tppabs="http://www.python.org/doc/current/lib/module-syslog.html"><img src="next.gif" tppabs="http://www.python.org/doc/current/icons/next.gif" border="0" height="32"
alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td><A href="contents.html" tppabs="http://www.python.org/doc/current/lib/contents.html"><img src="contents.gif" tppabs="http://www.python.org/doc/current/icons/contents.gif" border="0" height="32"
alt="Contents" width="32"></A></td>
<td><a href="modindex.html" tppabs="http://www.python.org/doc/current/lib/modindex.html" title="Module Index"><img src="modules.gif" tppabs="http://www.python.org/doc/current/icons/modules.gif" border="0" height="32"
alt="Module Index" width="32"></a></td>
<td><A href="genindex.html" tppabs="http://www.python.org/doc/current/lib/genindex.html"><img src="index.gif" tppabs="http://www.python.org/doc/current/icons/index.gif" border="0" height="32"
alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" HREF="node216.html" tppabs="http://www.python.org/doc/current/lib/node216.html">8.15.2 Resource Usage</A>
<b class="navlabel">Up:</b> <a class="sectref" href="unix.html" tppabs="http://www.python.org/doc/current/lib/unix.html">8. Unix Specific Services</A>
<b class="navlabel">Next:</b> <a class="sectref" href="module-syslog.html" tppabs="http://www.python.org/doc/current/lib/module-syslog.html">8.17 syslog </A>
<br><hr></DIV>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION00101600000000000000000">
8.16 <tt class="module">nis</tt> --
Interface to Sun's NIS (Yellow Pages)</A>
</H1>
<P>
<p class='availability'>Availability: <span
class='platform'>UNIX</span>.</p>
<P>
The <tt class="module">nis</tt> module gives a thin wrapper around the NIS library, useful
for central administration of several hosts.
<P>
Because NIS exists only on Unix systems, this module is
only available for Unix.
<P>
The <tt class="module">nis</tt> module defines the following functions:
<P>
<dl><dt><b><a name='l2h-1923'><tt class='function'>match</tt></a></b> (<var>key, mapname</var>)
<dd>
Return the match for <var>key</var> in map <var>mapname</var>, or raise an
error (<tt class="exception">nis.error</tt>) if there is none.
Both should be strings, <var>key</var> is 8-bit clean.
Return value is an arbitrary array of bytes (i.e., may contain <code>NULL</code>
and other joys).
<P>
Note that <var>mapname</var> is first checked if it is an alias to another name.
</dl>
<P>
<dl><dt><b><a name='l2h-1924'><tt class='function'>cat</tt></a></b> (<var>mapname</var>)
<dd>
Return a dictionary mapping <var>key</var> to <var>value</var> such that
<code>match(<var>key</var>, <var>mapname</var>)==<var>value</var></code>.
Note that both keys and values of the dictionary are arbitrary
arrays of bytes.
<P>
Note that <var>mapname</var> is first checked if it is an alias to another name.
</dl>
<P>
<dl><dt><b><a name='l2h-1925'><tt class='function'>maps</tt></a></b> ()
<dd>
Return a list of all valid maps.
</dl>
<P>
The <tt class="module">nis</tt> module defines the following exception:
<P>
<dl><dt><b><a name='l2h-1926'><tt class='exception'>error</tt></a></b>
<dd>
An error raised when a NIS function returns an error code.
</dl>
<DIV CLASS="navigation"><p><hr><table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A HREF="node216.html" tppabs="http://www.python.org/doc/current/lib/node216.html"><img src="previous.gif" tppabs="http://www.python.org/doc/current/icons/previous.gif" border="0" height="32"
alt="Previous Page" width="32"></A></td>
<td><A href="unix.html" tppabs="http://www.python.org/doc/current/lib/unix.html"><img src="up.gif" tppabs="http://www.python.org/doc/current/icons/up.gif" border="0" height="32"
alt="Up One Level" width="32"></A></td>
<td><A href="module-syslog.html" tppabs="http://www.python.org/doc/current/lib/module-syslog.html"><img src="next.gif" tppabs="http://www.python.org/doc/current/icons/next.gif" border="0" height="32"
alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td><A href="contents.html" tppabs="http://www.python.org/doc/current/lib/contents.html"><img src="contents.gif" tppabs="http://www.python.org/doc/current/icons/contents.gif" border="0" height="32"
alt="Contents" width="32"></A></td>
<td><a href="modindex.html" tppabs="http://www.python.org/doc/current/lib/modindex.html" title="Module Index"><img src="modules.gif" tppabs="http://www.python.org/doc/current/icons/modules.gif" border="0" height="32"
alt="Module Index" width="32"></a></td>
<td><A href="genindex.html" tppabs="http://www.python.org/doc/current/lib/genindex.html"><img src="index.gif" tppabs="http://www.python.org/doc/current/icons/index.gif" border="0" height="32"
alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" HREF="node216.html" tppabs="http://www.python.org/doc/current/lib/node216.html">8.15.2 Resource Usage</A>
<b class="navlabel">Up:</b> <a class="sectref" href="unix.html" tppabs="http://www.python.org/doc/current/lib/unix.html">8. Unix Specific Services</A>
<b class="navlabel">Next:</b> <a class="sectref" href="module-syslog.html" tppabs="http://www.python.org/doc/current/lib/module-syslog.html">8.17 syslog </A>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
<hr>See <i><a href="about.html" tppabs="http://www.python.org/doc/current/lib/about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -