Execute Python script from network share to windows system through pssh

169 views Asked by At

there is python script in mounted network location (K:/temp/abc.py) in host (Host-01) I am trying to ssh Host-01 from My PC

but this is not working. Although simple commands like 'whoami' are working. I tried giving full path as well (//my-net-drive/data/temp/abc.py)

Please suggest how i can run abc.py from net drive through ssh. It is working fine when I remote log in to Host-01 and run script via cmd prompt

from __future__ import print_function

from pssh.clients import ParallelSSHClient

hosts = ['Host-01']
client = ParallelSSHClient(hosts)

output = client.run_command('python K:/temp/abc.py')
for host, host_output in output.items():
    for line in host_output.stdout:
        print(line)

Command is executed but no output is shown. When I read output buffer, it is empty. And yes I have tried giving full path to python.exe but still seeing same results

When I copy python file from network drive to desktop and run python file from desktop through ssh it works fine.

0

There are 0 answers