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

📄 262.html

📁 Python Ebook Python&XML
💻 HTML
📖 第 1 页 / 共 2 页
字号:

					<p>Returns the magic number for Python bytecode files (also known as <tt class="monofont">.pyc</tt> and <tt claSs="monofont">.pyo</tT> files). The magic number should be present in the first four bytes of the bytecode file, in little-endian byte order.</p>

					<prE>
						
PyObject* PyImport_GetModuleDict()

					</pre>

					<p>Return value: Borrowed reference. Returns the dictionary used for the module administration (also known as <Tt clASS="monofont">sys.modules</Tt>). Note that this is a per-interpreter variable.</p>

					<prE>
						
void _PyImport_Init()

					</PRE>

					<p>Initializes the import mechanism. For internal use only.</p>

					<prE>
						
void PyImport_Cleanup()

					</PRE>

					<p>Empties the module table. For internal use only.</p>

					<prE>
						
void _PyImport_Fini()

					</PRE>

					<p>Finalizes the import mechanism. For internal use only.</p>

					<pre>
						
PyObject* _PyImport_FindExtension(char *, char *)

					</pre>

					<p>Return value: Borrowed reference. For internal use only.</p>

					<pre>
						
PyObject* _PyImport_FixupExtension(char *, char *)

					</pre>

					<p>For internal use only.</p>

					<prE>
						
int PyImport_ImportFrozenModule(char *)

					</prE>

					<p>Loads a frozen module. Returns <tt Class="monofont">1</Tt> for success, <tt CLASs="monofont">0</tt> if the module is not found, and <tT CLAss="monofont">-1</tt> with an exception set if the initialization failed. To access the imported module on a successful load, uses <TT CLass="monofont">PyImport_ImportModule().</tT> (Note the misnomer梩his function would reload the module if it was already imported.)</P>

					<PRe>
						
struct _frozen

					</pre>

					<p>This is the structure type definition for frozen module descriptors, as generated by the freeze utility (see Tools/freeze/ in the Python source distribution). Its definition is</p>

					<pre>
						
struct _frozen {
    char *name;
    unsigned char *code;
    int size;
} ;

struct _frozen* PyImport_FrozenModules

					</pre>

					<p>This pointer is initialized to point to an array of <tt class="monofont">struct</Tt>
						<tT claSs="monofont">_frozen</tt> records, terminated by one whose members are all <tT claSS="monofont">NULL</TT> or zero. When a frozen module is imported, it is searched in this table. Third-party code could play tricks with this to provide a dynamically created collection of frozen modules.<a namE="idx1073750998"></A><A Name="idx1073750999"></a><A NAMe="idx1073751000"></a><a nAME="idx1073751001"></A><a name="idx1073751002"></a><a name="idx1073751003"></a></p>

				
			</font>
<P><TABLE width="100%" border=0><TR valign="top"><TD><font size=1 color="#C0C0C0"><br></font></TD><TD align=right><font size=1 color="#C0C0C0">Last updated on 1/30/2002<br>Python Developer's Handbook, &copy;&nbsp;2002 Sams Publishing</font></TD></TR></TABLE></P>
<TABLE border=0 width="100%" cellspacing=0 cellpadding=0><TR><td align=left width="15%" class="headingsubbarbg"><a href="261.html" title="Standard Exceptions"><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=262" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="262.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="263.html" title="Abstract Objects Layer"><font size="1">CONTINUE&nbsp;&gt;</font></a></td></TR></TABLE>
</TD></TR></TABLE>
<br><TABLE width=100% bgcolor=white border=0 cellspacing=0 cellpadding=5><TR><TD><H4 class=Title>Index terms contained in this section</H4>
<font size=2>
Application Programmers Interface (API)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Python/C<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750980">utility tasks</a> <a href="#idx1073750987">2nd</a> <a href="#idx1073750993">3rd</a> <a href="#idx1073750999">4th</a><BR>
functions<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;importing<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750991">modules</a> <a href="#idx1073750997">2nd</a> <a href="#idx1073751003">3rd</a><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;utilities<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750978">OS</a><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750985">process control</a><BR>
importing<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750990">modules</a> <a href="#idx1073750996">2nd</a> <a href="#idx1073751002">3rd</a><BR>
interfaces<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Python/C Application Programmers (API)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750981">utility tasks</a> <a href="#idx1073750988">2nd</a> <a href="#idx1073750994">3rd</a> <a href="#idx1073751000">4th</a><BR>
modules<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750989">importing</a> <a href="#idx1073750995">2nd</a> <a href="#idx1073751001">3rd</a><BR>
 <a href="#idx1073750976">OS utilities</a><BR>
 <a href="#idx1073750983">process control utilities</a><BR>
Python/C Application Programmers Interface (API)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750979">utility tasks</a> <a href="#idx1073750986">2nd</a> <a href="#idx1073750992">3rd</a> <a href="#idx1073750998">4th</a><BR>
tools<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750977">OS</a><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750984">process control</a><BR>
utilities<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750975">OS</a><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073750982">process control</a><BR>
<BR>
</font></TD></TR></TABLE>




<!--EndOfBrowse-->

</TD></TR></TABLE>
<table width=100% border=0 cellspacing=0 cellpadding=0 bgcolor=#990000><tr><td><p align=center><font size=1 face="verdana,arial,helvetica" color=white>

⌨️ 快捷键说明

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