# Telnet into gateway from Python

**URL:** <https://forums.digi.com/t/telnet-into-gateway-from-python/2955>\
**Category:** Python\
**Created:** [June 26, 2009, 1:04pm UTC](https://forums.digi.com/t/telnet-into-gateway-from-python/2955 "2009-06-26T13:04:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Red0x](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Red0x](https://forums.digi.com/u/Red0x)\
**Post date:** [June 26, 2009, 1:04pm UTC](https://forums.digi.com/t/telnet-into-gateway-from-python/2955/1 "2009-06-26T13:04:59Z")

</div>

Is is possible to telnet or SSH into the gateway from Python? It would be nice to be able to configure the gateway directly from Python.

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [June 26, 2009, 1:26pm UTC](https://forums.digi.com/t/telnet-into-gateway-from-python/2955/2 "2009-06-26T13:26:48Z")

</div>

If you mean python on the gateway into the gateway, see the documentation at: [http://www.digi.com/wiki/developer/index.php/Module:digicli](http://www.digi.com/wiki/developer/index.php/Module:digicli)

If you mean python on a PC into remote gateway, then use the normal Python telnet library. We have example code here:  
[http://www.digi.com/wiki/developer/index.php/Use\_Telnet\_to\_Configure](http://www.digi.com/wiki/developer/index.php/Use_Telnet_to_Configure)

---

<div class="post-metadata">

**Author:** ![52637p](https://avatars.discourse-cdn.com/v4/letter/5/c6cbf5/32.png) [@52637p](https://forums.digi.com/u/52637p)\
**Post date:** [June 26, 2009, 1:45pm UTC](https://forums.digi.com/t/telnet-into-gateway-from-python/2955/3 "2009-06-26T13:45:46Z")

</div>

To clarify… the “digicli” module allows one to execute non-interactive Digi CLI commands on the running device without the need to create a socket connection or involve “telnet”.

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [June 26, 2009, 2:25pm UTC](https://forums.digi.com/t/telnet-into-gateway-from-python/2955/4 "2009-06-26T14:25:31Z")

</div>

What 52637p says is true - plus gateway-based Python code CAN open a telnet or ssh socket on localhost (127.0.0.1) to have a real session. You’ll just need to deal with login and authentication.

Yet digicli allows you to call once to for example “read” the TCP keepalive settings. Then call a second time if you wish to change them. So you can gain the basic effect of interaction one small transaction at a time.
