0

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.

  • 2
    Instead of "not working" you should really include details of what actually happens. – James Z Jul 31 '20 at 20:38
  • 1
    Please copy and paste the text of any message that appear. Have you tried specifying a fully qualified path to `python.exe`? – lit Jul 31 '20 at 20:43
  • 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 – Aditya Singh Aug 01 '20 at 01:15
  • What is inside abc.py? because I have tried with simple print statements and its working – Axecalever Aug 01 '20 at 09:34
  • For me even simple print statements are not working. It is not able to run python from shared Drive although if i copy to desktop and ssh same cmd it works fine – Aditya Singh Aug 01 '20 at 11:15

0 Answers0