Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Python Programming/Sockets

From Wikibooks, open books for an open world
<Python Programming
Previous: ThreadingIndexNext: GUI Programming


This page or section is an undeveloped draft or outline.
You can help todevelop the work, or you can ask for assistance in theproject room.

HTTP Client

[edit |edit source]

Make a very simple HTTP client

importsockets=socket.socket()s.connect(('localhost',80))s.send('GET / HTTP/1.1\nHost:localhost\n\n')s.recv(40000)# receive 40000 bytes

NTP/Sockets

[edit |edit source]

Connecting to and reading an NTP time server, returning the time as follows

ntpps       picoseconds portion of timentps        seconds portion of timentpms       milliseconds portion of timentpt        64-bit ntp time, seconds in upper 32-bits, picoseconds in lower 32-bits
Previous: ThreadingIndexNext: GUI Programming
Retrieved from "https://en.wikibooks.org/w/index.php?title=Python_Programming/Sockets&oldid=4309637"
Category:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp