亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

python網絡編程之讀取網站根目錄實例

系統 1963 0

本文實例講述了python網絡編程之讀取網站根目錄的方法,分享給大家供大家參考。

具體實現方法如下:

            
import socket, sys 
 
port = 70 
host = "quux.org" 
filename = "http://" 
 
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 
s.connect((host, port)) 
s.sendall(filename+"\r\n") 
 
while(1): 
  buf = s.recv(2048) 
  if not buf: 
    break 
  sys.stdout.write(buf) 


          

本文實例運行環境為Python2.7.6

該實例會返回quux.org的根目錄的列表

返回結果如下:

            
iWelcome to gopher at quux.org! fake (NULL) 0
i fake (NULL) 0
iThis server has a lot of information of historic interest, fake (NULL) 0
ifunny, or just plain entertaining -- all presented in Gopher. fake (NULL) 0
iThere are many mirrors here of rare or valuable files with the fake (NULL) 0
iaim to preserve them in case their host disappears. PLEASE READ fake (NULL) 0
i"About This Server" FOR IMPORTANT NOTES AND LEGAL INFORMATION. fake (NULL) 0
i fake (NULL) 0
0About This Server /About This Server.txt gopher.quux.org 70 +
1Archives /Archives gopher.quux.org 70 +
1Books /Books gopher.quux.org 70 +
1Communication /Communication gopher.quux.org 70 +
iThis directory contains the entire text of the book fake (NULL) 0
i"We the Media: Grassroots Journalism by the People, for the People" fake (NULL) 0
iby Dan Gillmor in various formats. fake (NULL) 0
i fake (NULL) 0
iFeel free to download and enjoy. fake (NULL) 0
1Computers /Computers gopher.quux.org 70 +
1Current Issues and Events (Updated Apr. 23, 2002) /Current gopher.quux.org 70 +
1Development Projects /devel gopher.quux.org 70 +
0Gopher's 10th Anniversary /3.0.0.txt gopher.quux.org 70
1Government, Politics, Law, and Conflict /Government gopher.quux.org 70 +
0How To Help /How To Help.txt gopher.quux.org 70 +
1Humor and Fun /Humor and Fun gopher.quux.org 70 +
1Index to Quux.Org /Archives/index gopher.quux.org 70
1Internet /Internet gopher.quux.org 70 +
1Other Gopher Servers /Software/Gopher/servers gopher.quux.org 70
1People /People gopher.quux.org 70 +
1Reference /Reference gopher.quux.org 70 +
1Software and Downloads /Software gopher.quux.org 70 +
1The Gopher Project /Software/Gopher gopher.quux.org 70
0What's New /whatsnew.txt gopher.quux.org 70 +


          

希望本文所述對大家的Python程序設計有所幫助


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日韩三级久久 | 午夜激情婷婷 | 国产一区视频在线免费观看 | 国产成人精品高清不卡在线 | 久久精品这里热有精品 | 国产国产精品四虎视频精品 | 日韩特级毛片 | 亚洲天堂久久新 | 日本一级毛片在线播放 | 日韩国产欧美精品综合二区 | 天天干天天玩天天操 | 亚洲产在线精品第一站不卡 | 曰曰鲁夜夜免费播放视频 | 正在播放国产乱子伦视频 | 日本一区二区日本免费 | 99久热re在线精品视频 | 久久成人18免费网站 | 狠狠色欧美亚洲综合色黑a 狠狠色视频 | 久久中文视频 | 亚洲另类老妇videos | 亚洲精品久久一区影院 | 日韩经典一区 | 337p日本大胆欧美人术艺术6 | 日本一级毛片视频无遮挡免费 | 亚洲欧美在线观看一区二区 | 91在线精品免费观看 | 国产品精人成福利视频 | 天堂成人精品视频在线观 | 成人a视频片在线观看免费 成人a视频在线观看 | 欧美日本综合一区二区三区 | 成年女人午夜毛片免费看 | 欧美激情一区二区三区视频 | 成人影院欧美大片免费看 | 91破解版在线 | 亚洲 | 免费视频爰爱太爽了 | 天天做爽夜夜做爽 | 日韩字幕 | 99久久这里只有精品 | 日本在线亚州精品视频在线 | 国产精品 视频一区 二区三区 | 四虎精品成人免费永久 |