Is there a way that I can use Python on Windows to execute shell scripts which are located on a remote Unix machine?
P.S: Sorry about the late edit. I do know of Paramiko, but I wanted to know if there is way of doing it without it. For starters, could it be done with subprocess()?
You will need to ssh into the remote machine and if you have appropriate credentials, you can invoke the shell scripts.
For using ssh, you can easily use paramiko module that provides ssh automation
- http://www.lag.net/paramiko/
A typical example:
import paramiko
import sys
import os
import os.path
passwd = ""
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('servername', username, password=passwd)
stdin, stdout, stderr = ssh.exec_command('df -h')
x = stdout.readlines()
print x
for line in x:print line
ssh.close()
Replace "df -h" command with the your shell script.