Python编程
Completion requirements
HTTP Client
[edit | edit source]Make a very simple HTTP client
import socket
s = 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 time ntps seconds portion of time ntpms milliseconds portion of time ntpt 64-bit ntp time, seconds in upper 32-bits, picoseconds in lower 32-bits
Last modified: Friday, 31 January 2025, 1:26 AM