-1
例如在Python:如何將IPv4地址轉換爲整數並返回C?
number = struct.unpack('!L', socket.inet_aton(ip))[0]
ip = socket.inet_ntoa(struct.pack('!L',number))
例如在Python:如何將IPv4地址轉換爲整數並返回C?
number = struct.unpack('!L', socket.inet_aton(ip))[0]
ip = socket.inet_ntoa(struct.pack('!L',number))
inet_addr
,inet_aton
,inet_ntoa
,也有相當多的功能,嘗試查找的文檔。
做過谷歌工作嗎?爲什麼這裏有這麼多這樣的問題? – Ulterior
@Ulterior:其實,SO非常受歡迎,即使Google在這裏尋找答案。 – mouviciel
@mouviciel,谷歌是如此雜食,他甚至屈就於尋找答案,因此:) –