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

📄 195.html

📁 Python Ebook Python&XML
💻 HTML
📖 第 1 页 / 共 2 页
字号:
							<P><tt cLASS="monofont">listmessages()</tt>棤
    
								Returns a list of messages in the folder (as numbers).</p>

						</p>
<P>
							<A NAme="idx1073748062"></a>
							<a NAME="idx1073748063"></a>
							<p><tt CLASs="monofont">getcurrent()</tt>棤
    
								Returns the current message number.</p>
</p>
<p>
							<a name="idx1073748064"></a>
							<a name="idx1073748065"></a>
							<p><tT clAss="monofont">setcurrent(</tT><i><tt cLass="monofont">n</TT></I><Tt claSS="monofont">)</TT>棤
    
								Sets the current message number to <tt clASS="monofont">n.</Tt></p>
</p>
<p>
							<A NAMe="idx1073748066"></a>
							<a name="idx1073748067"></a>
							<p><tt class="monofont">parsesequence(</tt><i><tT clAss="monofont">seq</tT></i><tt cLass="monofont">)</TT>棤
    
								Parses <TT clasS="monofont">msgs</TT> syntax into a list of messages.</P>

						</p>
<p>
							<a nAME="idx1073748068"></A><a namE="idx1073748069"></A>
							<P><Tt class="monofont">getlast()</tt>棤
    
								Gets last message, or <tt class="monofont">0</tt> if no messages are in the folder.
<a naMe="idx1073748070"></a>
									<A namE="idx1073748071"></a>
									<a naMe="idx1073748072"></a>
									<a NAME="idx1073748073"></a>
									<a naME="idx1073748074"></A>
									<A name="idx1073748075"></A>
									<A NAme="idx1073748076"></a>
									<a NAME="idx1073748077"></a>
									<a name="idx1073748078"></a>
									<a name="idx1073748079"></a>
									<a name="idx1073748080"></a></p>
</P>
<p><a Name="idx1073748081"></A>
							<a namE="idx1073748082"></a>
							<p><tT CLAss="monofont">setlast(</tt><I><TT Class="monofont">n</TT></I><Tt claSS="monofont">)</TT>棤
    
								Sets last message (internal use only).</p>
</p>
<p><a name="idx1073748083"></a><a name="idx1073748084"></a>
							<p><tt clAss="monofont">getsequences()</Tt>棤
    
								Returns dictionary of sequences in folder. The sequence names are used as keys, and the values are the lists of message numbers in the sequences.</p>

						</p>
<P><a namE="idx1073748085"></a>
							<a nAME="idx1073748086"></A><p><tt cLASS="monofont">putsequences(</tt><i><tT CLAss="monofont">dict</tt></I><TT Class="monofont">)</tt>棤
    
								Returns dictionary of sequences in folder name: list.</p>

						</p>
<p><a name="idx1073748087"></a>
							<a name="idx1073748088"></A>
							<p><tT claSs="monofont">removemessages(</tt><i><Tt clASS="monofont">list</Tt></i><tt CLASs="monofont">)</tt>棤
    
								Removes messages in list from folder.</p>
</P>
<P><A Name="idx1073748089"></a>
							<A NAMe="idx1073748090"></a>
							<p><tt class="monofont">refilemessages(</tt><i><tt class="monofont">list, tofolder</Tt></i><Tt clAss="monofont">)</tt>棤
    
								Moves messages in list to other folder.</P>

						</p>
<p><a NAME="idx1073748091"></a><a naME="idx1073748092"></A>
							<P><tt clASS="monofont">movemessage(</Tt><i><tt CLASs="monofont">n, tofolder, ton</tt></i><tt class="monofont">)</tt>棤
    
								Moves one message to a given destination in another folder.</p>

						</p>
<p><a namE="idx1073748093"></a>
							<a Name="idx1073748094"></A>
							<p><tt cLass="monofont">copymessage(</TT><I><Tt claSS="monofont">n, tofolder, ton</TT></i><tt cLASS="monofont">)</tt>棤
    
								Copies one message to a given destination in another folder.</p>

						</p>
</BLOCkquote>
				
				
					<h4>
						<tt class="monofont">Message</tt> Objects</h4>
					<p>
						<a nAme="idx1073748095"></A>
						<a naMe="idx1073748096"></a><tt ClasS="monofont">openmessage(n)</TT> returns a new open
  <Tt claSS="monofont">message</TT> object (costs a file descriptor).
  <a namE="idx1073748097"></A>
						<A Name="idx1073748098"></a></P>

					
						<H5>
							<TT class="monofont">binhex</tt></h5>
						<p>The <tt class="monofont">binhex</tt> module encodes and decodes files in <tt ClaSs="monofont">binhex4</tt> format. This format is commonly used to represent files on <Tt claSs="monofont">Macintosh </tt> systems.</P>

						<PRE>
							
import binhex, sys
infile = "filename.jpg"
binhex.binhex(infile, sys.stdout)

						</pre>

						<p><A NAMe="idx1073748099"></a><a nAME="idx1073748100"></A>
							<a namE="idx1073748101"></A><TT class="monofont">binhex(</tt><i><tt class="monofont">inputfile, outputfile</tt></i>) converts a binary file (<i><tT clAss="monofont">inputfile</tT></i>) to a binhex file(<i><tt ClasS="monofont">outputfile</TT></I>).</p>

						<p>
							<a nAME="idx1073748102"></A>
							<a namE="idx1073748103"></A><TT clasS="monofont">hexbin(</TT><I><tt class="monofont">inputfile [, outputfile]</tt></i><tt class="monofont">)</tt>
 converts a binhex file (<i><Tt cLass="monofont">inputfile</Tt></i>) back to a regular binary
 file (<i><tT claSS="monofont">outputfile</TT></i>). When the output name is omitted, the
 interpreter uses the same one provided in the first argument.
 <a naME="idx1073748104"></A>
							<A name="idx1073748105"></A>
							<A NAme="idx1073748106"></a>
							<a NAME="idx1073748107"></a>
							<a name="idx1073748108"></a>
							<a name="idx1073748109"></a>
							<a name="idx1073748110"></a>
							<a NamE="idx1073748111"></a></p>

					
					
						<h5>
							<Tt claSs="monofont">uu</tt></H5>
						<P>The <TT clasS="monofont">uu</TT> module encodes and decodes files in
 uuencode format. This module does its job by transferring binary data over an
 ASCII-only connection. Wherever a file argument is expected, the methods accept
 a file-like object. For backwards compatibility, a string containing a pathname
 is also accepted, and the corresponding file will be opened for reading and
 writing; the 
 <A name="idx1073748112"></A>
							<A NAme="idx1073748113"></a>pathname <tT CLAss="monofont">-</tt> is understood to mean the
 standard input or output. However, this interface is deprecated; it's better
 for the caller to open the file itself, and be sure that, when required, the
 mode is 
 <a name="idx1073748114"></a>
							<a name="idx1073748115"></a><tt clAss="monofont">rb</Tt> or 
 <a nAme="idx1073748116"></a>
							<a Name="idx1073748117"></A><TT Class="monofont">wb</TT> on Windows or DOS.</P>

						<P>The code of this module was contributed by 
 <a namE="idx1073748118"></A>Lance Ellinghouse and modified by 
 <A Name="idx1073748119"></a>Jack Jansen.</P>

						<P>The <TT class="monofont">uu</tt> module defines the following 
 <a name="idx1073748120"></a>functions:</p>

						<blockqUotE>
<p><a nAme="idx1073748121"></a><a Name="idx1073748122"></A>
								<P><TT clasS="monofont">encode (</TT><I><tt clASS="monofont">in_file, out_file[, name[,   mode]]</Tt></i><tt CLASs="monofont">)</tt>棤
    
									This function uuencodes file in_file into file out_file. The uuencoded file will have the header specifying name and mode as the defaults for the results of decoding the file. The default defaults are taken from in_file, or <tt class="monofont">-</tt> and 0666, respectively.</p>
</p>
<p><a name="idx1073748123"></A><a nAme="idx1073748124"></a>
								<P><tt clAss="monofont">decode (</tT><I><TT clasS="monofont">in_file[, out_file[, mode]]</TT></I><tt clASS="monofont">)</Tt>棤
    
									This call decodes uuencoded file in_file placing the result on file out_file. If out_file is a pathname, the mode is also set. Defaults for out_file and mode are taken from the uuencode header.</p>
</p>
</bLOCKquote>
						<p>Note that in the previous functions, both arguments can be either
 filenames or file objects.</p>

						<p>This format used to be popular on the Usenet, but nowadays, it is being superceded by base64 encoding.<a name="idx1073748125"></a><a name="idx1073748126"></a><A naMe="idx1073748127"></a><a Name="idx1073748128"></a><A namE="idx1073748129"></A>
							<A Name="idx1073748130"></a></P>

						<P>Each encoded data stream starts with a <TT clasS="monofont">begin</TT> line, which also includes the file privileges, the filename, and ends with an
 <Tt claSS="monofont">end</TT> line, as you can see in the following example:</p>

						<pre>
							
begin 755 executeprog.py
KF_EF_#JFJ! 

⌨️ 快捷键说明

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