def execute(self,command):
to_exec = self.transport.open_session()
to_exec.exec_command(command)
print 'Command executed'
connection.execute("install.sh")
Run Code Online (Sandbox Code Playgroud)
当我检查远程系统时,我发现脚本没有运行.任何线索?
我想触发一个 python 脚本,该脚本发送回 JSON 数据响应。从技术上讲,我希望它像 Rest API 一样工作,而不需要创建 Rest API。
我想如何调用?
http://www.123.456.789.012/my_python_script/my_function
Run Code Online (Sandbox Code Playgroud)
点击此 URL 应触发 python 脚本,并运行必要的函数 (my_function()),并且该函数需要发回 JSON 响应。我将使用我的机器触发脚本Python Requests Module
你能告诉我一种如何做到这一点的方法吗?提前致谢
我在我的本地机器上有一个python脚本.有没有办法在远程机器上运行这个脚本.我的意思是python脚本应该在本地机器上,但执行应该在远程机器上进行,并将输出返回到本地机器.