Python Forum

Full Version: Why Python for Network Programming
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey folks. I’ve been spending some time playing around with Python with a focus on network programmability, automation and SDN.

But the one thing I can’t understand is why Python?

I have experience with NodeJS and Ruby. But everywhere you look, Python is predominantly used for network automation and SDN.

Why not NodeJS or Ruby or any other programming language for that matter? Is it just preference or am I missing something?
I think it has to do with the implementation + language features + history.
CPython has a very thin wrapper around sockets, which allows low-level access.

In addition, we have all important High-Level networking libraries since the beginning of Twisted (2002).
For example, node.js was released 2009. Python was released 1990 and Ruby 1995.
The first version of Python existed even before the web was accessible.
Threads were introduced 1996 in the Linux-Kernel.
So Python even existed before PThreads were introduced in the Linux-Kernel.

Since Python 3.5 we have also asyncio support for io.


I think the history, the syntax and libraries made Python indispensable for networking.
Python is also known as glue language. By the way, the ruby-syntax is not far away from Pythons syntax.