Run local python script on remote server

前端 未结 5 1806
清歌不尽
清歌不尽 2020-11-30 20:02

I\'m debugging some python script that must run on my virtual machine. And, I prefer to edit the scripts locally(outside of virtual machines). So I find it\'s tediou

5条回答
  •  半阙折子戏
    2020-11-30 20:11

    It is possible using ssh. Python accepts hyphen(-) as argument to execute the standard input,

    cat hello.py | ssh user@192.168.1.101 python -
    

    Run python --help for more info.

提交回复
热议问题