資源簡介
RPC(remote procedure call)是一種CS模式的交互方式,他隱藏了傳輸層和應用層的協議,在本地客戶端執行函數的調用,服務器端相應接口函數響應請求,完成計算后返回結果到客戶端繼續執行后續邏輯
代碼片段和文件信息
#?client.py?
import?xmlrpc.client
proxy?=?xmlrpc.client.ServerProxy(“http://localhost:8000/“)
with?open(“fetched_python_logo.jpg“?“wb“)?as?handle:
????handle.write(proxy.python_logo().data)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????59142??2016-06-01?18:09??python_logo.jpg
?????文件?????????378??2020-01-05?08:51??server.py
?????文件?????????196??2020-01-05?08:52??client.py
- 上一篇:python貪吃蛇小游戲源碼
- 下一篇:超級好玩的python畫圖
評論
共有 條評論