'executing local script on remote server with local input file

I have a python script and input data that the python script takes. I want to execute the python script on remote server without copying python script and data to the remote server.

I tried the script:

ssh [email protected] "cd /home/dong/fold python -u -" <  script.py arg1

It execute the script but the arg1(which is input data) python script doesn't take from local machine but when the input data present in remote server it works.

I hope experts may show some way to overcoming this problem.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source