用法:
NNTP.over(message_spec, *, file=None)在舊版服務器上發送
OVER命令或XOVER命令。message_spec可以是表示消息 id 的字符串,也可以是表示當前組中文章範圍的(first, last)數字元組,也可以是表示從first到最後一篇文章的範圍的(first, None)元組當前組中的文章,或None選擇當前組中的當前文章。返回一對
(response, overviews)。overviews是(article_number, overview)元組的列表,每個元組對應message_spec選擇的每篇文章。每個overview是一個具有相同數量項目的字典,但這個數量取決於服務器。這些項目或者是消息標頭(鍵是 lower-cased 標頭名稱),或者是元數據項目(鍵是元數據名稱前麵加上":")。 NNTP 規範保證存在以下項目:subject、from、date、message-id和references標頭:bytes元數據:整個原始文章中的字節數(包括標題和正文):lines元數據:文章正文中的行數
每個項目的值或者是一個字符串,或者是
None(如果不存在)。當標頭值可能包含非 ASCII 字符時,建議對標頭值使用
decode_header()函數:>>> _, _, first, last, _ = s.group('gmane.comp.python.devel') >>> resp, overviews = s.over((last, last)) >>> art_num, over = overviews[0] >>> art_num 117216 >>> list(over.keys()) ['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject'] >>> over['from'] '=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= <martin@v.loewis.de>' >>> nntplib.decode_header(over['from']) '"Martin v. Löwis" <martin@v.loewis.de>'3.2 版中的新函數。
相關用法
- Python nntplib.NNTP.getcapabilities用法及代碼示例
- Python nntplib.NNTP.descriptions用法及代碼示例
- Python nntplib.NNTP.article用法及代碼示例
- Python nntplib.NNTP.newgroups用法及代碼示例
- 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.over。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
