Upload files to "/"
This commit is contained in:
11
ipbin.py
Normal file
11
ipbin.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import ipaddress
|
||||||
|
|
||||||
|
ip = ipaddress.IPv4Address('172.16.0.0')
|
||||||
|
bits = '{:#b}'.format(ip).strip('0b')
|
||||||
|
|
||||||
|
result = ''
|
||||||
|
for i in range(0, 32, 4):
|
||||||
|
result += bits[i:i+4]
|
||||||
|
result += ' ' if (i + 4) % 8 == 0 else ' '
|
||||||
|
|
||||||
|
print(result.strip())
|
Reference in New Issue
Block a user