Execute a command on Remote Machine in Python
I am writing a program in python on Ubuntu, to execute a command ls -l on RaspberryPi, connect with Network. Can anybody guide me on how do I do that? 000 Sure, there are several ways to do it! Let's say you've got a Raspberry Pi on a raspberry.lan host and your username is irfan . subprocess It's the default Python library that runs commands. You can make it run ssh and do whatever you need on a remote server. scrat has it covered in his answer . You definitely should do this if you don't want to use any third-party libraries. You can also automate the password/passphrase entering using