In Python 3.3+ (or with this backport for 2.6 and 2.7), you can simply use ipaddress:

import ipaddress
addr = str(ipaddress.ip_address(167772160))
assert addr == '10.0.0.0'

Alternatively, you can manually pack the value

import socket,struct
packed_value = struct.pack('!I', 167772160)
addr = socket.inet_ntoa(packed_value)
assert addr == '10.0.0.0'

Error while pull from git - insufficient permission for adding an object to repository database .git/objects

Check the permissions of the .git/objects file. It sounds like you may have mistakenly used sudo at some point in the past and given ownership to root rather than to yourself. 

 
posted on 2017-09-15 10:16  Helenbj  阅读(275)  评论(0编辑  收藏  举报