Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80692 > unrolled thread
| Started by | Noah <noah-list@enabled.com> |
|---|---|
| First post | 2014-11-13 16:30 +0000 |
| Last post | 2014-11-14 10:03 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
netaddr value back to IP Noah <noah-list@enabled.com> - 2014-11-13 16:30 +0000
Re: netaddr value back to IP Michael Ströder <michael@stroeder.com> - 2014-11-14 10:03 +0100
| From | Noah <noah-list@enabled.com> |
|---|---|
| Date | 2014-11-13 16:30 +0000 |
| Subject | netaddr value back to IP |
| Message-ID | <mailman.15782.1415896539.18130.python-list@python.org> |
Hi there List,
I am trying to get a value back to IP using the netaddr python module.
How do I get the value 'ip' back to IP format? how is it done?
---- snip ----
print IPNetwork(v4_peer_ip).value
ip = IPNetwork(v4_peer_ip).value + 1
print ip
--- snip ---
Cheers,
Noah
[toc] | [next] | [standalone]
| From | Michael Ströder <michael@stroeder.com> |
|---|---|
| Date | 2014-11-14 10:03 +0100 |
| Message-ID | <m44gh0$er$1@dont-email.me> |
| In reply to | #80692 |
Noah wrote:
> I am trying to get a value back to IP using the netaddr python module.
> How do I get the value 'ip' back to IP format? how is it done?
>
> ---- snip ----
>
> print IPNetwork(v4_peer_ip).value
> ip = IPNetwork(v4_peer_ip).value + 1
> print ip
>
> --- snip ---
>>> ip=netaddr.IPAddress('192.168.71.20')
>>> ip+=1
>>> str(ip)
'192.168.71.21'
Ciao, Michael.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web