Software Engineer at Red Hat. Open Source contributor. GDE in Google Cloud. AWS CB in Cloud Operations. Interested in observability and a lot of stuff!
I think you want to compare the use of subprocess calling the ssh command, right? In that case, the performance degradation makes all the sense. Why? If you go to the official Paramiko's website it says:
Paramiko is a Python (2.7, 3.4+) implementation of the SSHv2 protocol [1], providing both client and server functionality. While it leverages a Python C extension for low level cryptography (Cryptography), Paramiko itself is a pure Python interface around SSH networking concepts.
So, it means Paramiko is implemented in pure Python and ssh in pure C. So, ssh performance will be better than the one in Paramiko.
But, why should I use Paramiko? Because Paramiko:
Provides you will all the methods to interact with your ssh/sftp/... session:
You can get the errors without needing to parse the commandline output or to check the exit code
Yeah I was thinking about the sftp since I need to push a file. I'd have to implement both, which would require more resources. Subprocess I think is better for ssh strictly speaking.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think you want to compare the use of
subprocess
calling thessh
command, right? In that case, the performance degradation makes all the sense. Why? If you go to the official Paramiko's website it says:So, it means
Paramiko
is implemented in pure Python andssh
in pureC
. So,ssh
performance will be better than the one inParamiko
.But, why should I use
Paramiko
? BecauseParamiko
:ssh
/sftp
/... session:We can say it is more... Python friendly :).
Yeah I was thinking about the sftp since I need to push a file. I'd have to implement both, which would require more resources. Subprocess I think is better for ssh strictly speaking.