Changeset 391 for python/trunk/Doc/library/nntplib.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/library/nntplib.rst
r2 r391 10 10 pair: NNTP; protocol 11 11 single: Network News Transfer Protocol 12 13 **Source code:** :source:`Lib/nntplib.py` 14 15 -------------- 12 16 13 17 This module defines the class :class:`NNTP` which implements the client side of … … 19 23 about a newsgroup and print the subjects of the last 10 articles:: 20 24 21 >>> s = NNTP('news. cwi.nl')22 >>> resp, count, first, last, name = s.group(' comp.lang.python')25 >>> s = NNTP('news.gmane.org') 26 >>> resp, count, first, last, name = s.group('gmane.comp.python.committers') 23 27 >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last 24 Group comp.lang.python has 59 articles, range 3742 to 380328 Group gmane.comp.python.committers has 1071 articles, range 1 to 1071 25 29 >>> resp, subs = s.xhdr('subject', first + '-' + last) 26 30 >>> for id, sub in subs[-10:]: print id, sub 27 31 ... 28 3792 Re: Removing elements from a list while iterating...29 3793 Re: Who likes Info files?30 3794 Emacs and doc strings31 3795 a few questions about the Mac implementation32 3796 Re: executable python scripts33 3797 Re: executable python scripts34 3798 Re: a few questions about the Mac implementation35 3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules36 3802 Re: executable python scripts37 3803 Re: \POSIX{} wait and SIGCHLD32 1062 Re: Mercurial Status? 33 1063 Re: [python-committers] (Windows) buildbots on 3.x 34 1064 Re: Mercurial Status? 35 1065 Re: Mercurial Status? 36 1066 Python 2.6.6 status 37 1067 Commit Privileges for Ask Solem 38 1068 Re: Commit Privileges for Ask Solem 39 1069 Re: Commit Privileges for Ask Solem 40 1070 Re: Commit Privileges for Ask Solem 41 1071 2.6.6 rc 2 38 42 >>> s.quit() 39 '205 news.cwi.nl closing connection. Goodbye.'43 '205 Bye!' 40 44 41 45 To post an article from a file (this assumes that the article has valid 42 headers )::43 44 >>> s = NNTP('news. cwi.nl')45 >>> f = open(' /tmp/article')46 headers, and that you have right to post on the particular newsgroup):: 47 48 >>> s = NNTP('news.gmane.org') 49 >>> f = open('articlefile') 46 50 >>> s.post(f) 47 51 '240 Article posted successfully.' 48 52 >>> s.quit() 49 '205 news.cwi.nl closing connection. Goodbye.'53 '205 Bye!' 50 54 51 55 The module itself defines the following items:
Note:
See TracChangeset
for help on using the changeset viewer.