skype4py-pysrc.html

来自「基于python的skype的API的说明文档」· HTML 代码 · 共 183 行 · 第 1/2 页

HTML
183
字号
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt><a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line"><tt class="py-docstring">     This short example connects to Skype client and prints the user's full name and the names of all the</tt> </tt><a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line"><tt class="py-docstring">     contacts from the contacts list::</tt> </tt><a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt><a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line"><tt class="py-docstring">         import Skype4Py</tt> </tt><a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt><a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line"><tt class="py-docstring">         # Create Skype instance</tt> </tt><a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line"><tt class="py-docstring">         skype = Skype4Py.Skype()</tt> </tt><a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt><a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line"><tt class="py-docstring">         # Connect Skype object to Skype client</tt> </tt><a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line"><tt class="py-docstring">         skype.Attach()</tt> </tt><a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt><a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line"><tt class="py-docstring">         print 'Your full name:', skype.CurrentUser.FullName</tt> </tt><a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line"><tt class="py-docstring">         print 'Your contacts:'</tt> </tt><a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line"><tt class="py-docstring">         for user in skype.Friends:</tt> </tt><a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line"><tt class="py-docstring">             print '    ', user.FullName</tt> </tt><a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt><a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line"><tt class="py-docstring">@author: Arkadiusz Wahlig (arkadiusz.wahlig at googlemail)</tt> </tt><a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line"><tt class="py-docstring">@requires: Python 2.4 or newer (not yet 3.0)</tt> </tt><a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line"><tt class="py-docstring">@see: U{The Skype4Py webpage&lt;https://developer.skype.com/wiki/Skype4Py&gt;}</tt> </tt><a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line"><tt class="py-docstring">@license: BSD License (see the accompanying LICENSE file for more information)</tt> </tt><a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line"><tt class="py-docstring">@copyright: S{copy} 2007-2008 Arkadiusz Wahlig</tt> </tt><a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line"><tt class="py-docstring">'''</tt> </tt><a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line"> </tt><a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module Skype4Py.skype=Skype4Py.skype-module.html"><a title="Skype4Py.skype" class="py-name" href="#" onclick="return doclink('link-0', 'skype', 'link-0');">skype</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class Skype4Py.skype.ISkype=Skype4Py.skype.ISkype-class.html"><a title="Skype4Py.skype.ISkype" class="py-name" href="#" onclick="return doclink('link-1', 'ISkype', 'link-1');">ISkype</a></tt> <tt class="py-keyword">as</tt> <tt class="py-name">Skype</tt> </tt><a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Module Skype4Py.callchannel=Skype4Py.callchannel-module.html"><a title="Skype4Py.callchannel" class="py-name" href="#" onclick="return doclink('link-2', 'callchannel', 'link-2');">callchannel</a></tt> <tt class="py-keyword">import</tt> <tt id="link-3" class="py-name" targets="Class Skype4Py.callchannel.ICallChannelManager=Skype4Py.callchannel.ICallChannelManager-class.html"><a title="Skype4Py.callchannel.ICallChannelManager" class="py-name" href="#" onclick="return doclink('link-3', 'ICallChannelManager', 'link-3');">ICallChannelManager</a></tt> <tt class="py-keyword">as</tt> <tt class="py-name">CallChannelManager</tt> </tt><a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name" targets="Module Skype4Py.errors=Skype4Py.errors-module.html"><a title="Skype4Py.errors" class="py-name" href="#" onclick="return doclink('link-4', 'errors', 'link-4');">errors</a></tt> <tt class="py-keyword">import</tt> <tt id="link-5" class="py-name" targets="Class Skype4Py.errors.ISkypeError=Skype4Py.errors.ISkypeError-class.html"><a title="Skype4Py.errors.ISkypeError" class="py-name" href="#" onclick="return doclink('link-5', 'ISkypeError', 'link-5');">ISkypeError</a></tt> <tt class="py-keyword">as</tt> <tt class="py-name">SkypeError</tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name" targets="Class Skype4Py.errors.ISkypeAPIError=Skype4Py.errors.ISkypeAPIError-class.html"><a title="Skype4Py.errors.ISkypeAPIError" class="py-name" href="#" onclick="return doclink('link-6', 'ISkypeAPIError', 'link-6');">ISkypeAPIError</a></tt> <tt class="py-keyword">as</tt> <tt class="py-name">SkypeAPIError</tt> </tt><a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-7" class="py-name" targets="Module Skype4Py.enums=Skype4Py.enums-module.html"><a title="Skype4Py.enums" class="py-name" href="#" onclick="return doclink('link-7', 'enums', 'link-7');">enums</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt><a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line"> </tt><a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line"> </tt><a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line"><tt id="link-8" class="py-name" targets="Variable Skype4Py.__version__=Skype4Py-module.html#__version__"><a title="Skype4Py.__version__" class="py-name" href="#" onclick="return doclink('link-8', '__version__', 'link-8');">__version__</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'1.0.31.0'</tt> </tt><a name="L64"></a><tt class="py-lineno">64</tt>  <tt class="py-line"><tt class="py-string">'''The version of Skype4Py.'''</tt> </tt><a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line"> </tt><script type="text/javascript"><!--expandto(location.href);// --></script></pre><br /><!-- ==================== NAVIGATION BAR ==================== --><table class="navbar" border="0" width="100%" cellpadding="0"       bgcolor="#a0c0ff" cellspacing="0">  <tr valign="middle">  <!-- Home link -->      <th bgcolor="#70b0f0" class="navbar-select"          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>  <!-- Tree link -->      <th>&nbsp;&nbsp;&nbsp;<a        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>  <!-- Index link -->      <th>&nbsp;&nbsp;&nbsp;<a        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>  <!-- Help link -->      <th>&nbsp;&nbsp;&nbsp;<a        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>  <!-- Project homepage -->      <th class="navbar" align="right" width="100%">        <table border="0" cellpadding="0" cellspacing="0">          <tr><th class="navbar" align="center"            ><a class="navbar" target="_top" href="https://developer.skype.com/wiki/Skype4Py">Skype4Py</a></th>          </tr></table></th>  </tr></table><table border="0" cellpadding="0" cellspacing="0" width="100%%">  <tr>    <td align="left" class="footer">    Generated by Epydoc 3.0.1 on Wed Nov 05 14:55:02 2008    </td>    <td align="right" class="footer">      <a target="mainFrame" href="http://epydoc.sourceforge.net"        >http://epydoc.sourceforge.net</a>    </td>  </tr></table><script type="text/javascript">  <!--  // Private objects are initially displayed (because if  // javascript is turned off then we want them to be  // visible); but by default, we want to hide them.  So hide  // them unless we have a cookie that says to show them.  checkCookie();  // --></script></body></html>

⌨️ 快捷键说明

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