用法:
NNTP.article(message_spec=None, *, file=None)
發送
ARTICLE
命令,其中message_spec
與stat()
的含義相同。返回一個元組(response, info)
其中info
是具有三個屬性number
、message_id
和lines
的namedtuple
(按此順序)。number
是組中的文章編號(如果信息不可用,則為 0),message_id
是字符串形式的消息 ID,lines
是包含標題的原始消息的行列表(沒有終止換行符)與身體。>>> resp, info = s.article('<20030112190404.GE29873@epoch.metaslash.com>') >>> info.number 0 >>> info.message_id '<20030112190404.GE29873@epoch.metaslash.com>' >>> len(info.lines) 65 >>> info.lines[0] b'Path: main.gmane.org!not-for-mail' >>> info.lines[1] b'From: Neal Norwitz <neal@metaslash.com>' >>> info.lines[-3:] [b'There is a patch for 2.3 as well as 2.2.', b'', b'Neal']
相關用法
- Python nntplib.NNTP.getcapabilities用法及代碼示例
- Python nntplib.NNTP.descriptions用法及代碼示例
- Python nntplib.NNTP.newgroups用法及代碼示例
- Python nntplib.NNTP.over用法及代碼示例
- Python nntplib.NNTP.stat用法及代碼示例
- Python nntplib.NNTP用法及代碼示例
- Python nntplib.decode_header用法及代碼示例
- Python numpy.less()用法及代碼示例
- Python networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path用法及代碼示例
- Python numpy.polynomial.hermite.hermmul用法及代碼示例
- Python numpy.seterrobj用法及代碼示例
- Python networkx.classes.function.edge_subgraph用法及代碼示例
- Python numpy.tril()用法及代碼示例
- Python numpy.around用法及代碼示例
- Python networkx.algorithms.tree.mst.maximum_spanning_edges用法及代碼示例
- Python numpy.random.standard_normal()用法及代碼示例
- Python networkx.algorithms.bipartite.basic.color用法及代碼示例
- Python numpy.select用法及代碼示例
- Python networkx.algorithms.bipartite.cluster.latapy_clustering用法及代碼示例
- Python networkx.readwrite.json_graph.adjacency_data用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 nntplib.NNTP.article。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。