[IPython-User] Get IP's of connected engines?

Darren Govoni darren@ontrenet....
Tue Feb 28 12:13:03 CST 2012


Oh that's right. I recall something like this. I guess I wasn't sure if
it was built into client or something. Thanks!!

On Tue, 2012-02-28 at 09:01 -0800, MinRK wrote:
> The same way you would get IPs of the current machine in Python, just
> called remotely:
> 
> 
> def get_ips():
>     """return all IPs associated with each engine"""
>     import socket
>     return socket.gethostbyname_ex(socket.gethostname())
> 
> 
> # use AsyncResult.get_dict to conveniently get a dict by engine-id
> mapping = client[:].apply_async(get_ips).get_dict()
> 
> 
> -MinRK
> 
> On Tue, Feb 28, 2012 at 03:53, Darren Govoni <darren@ontrenet.com>
> wrote:
>         Hi,
>          I forget if this was asked before and I couldn't find it. But
>         is there
>         a way to get the IP addresses of connected engines from a
>         Client() or
>         similar interface?
>         
>         thanks.
>         
>         _______________________________________________
>         IPython-User mailing list
>         IPython-User@scipy.org
>         http://mail.scipy.org/mailman/listinfo/ipython-user
> 
> 
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user




More information about the IPython-User mailing list