Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

run python script on remote server

As others have said, pipe it into ssh. But what you will want to do is give the proper arguments. You will want to add -u to get the output back from ssh properly. And want to add - to handle the output and later arguments.

ssh user@host python -u - < script.py
If you want to give command line arguments, add them after the -.

ssh user@host python -u - --opt arg1 arg2 < script.py
Comment

PREVIOUS NEXT
Code Example
Python :: jupyter notebook cell background color 
Python :: pygame bg color 
Python :: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 
Python :: #remove a sublist from a list-use remove method 
Python :: python char at 
Python :: remove item from list 
Python :: from django.urls import re_path 
Python :: keyboard write python 
Python :: shuffle text lines python 
Python :: python pickle module 
Python :: fizz buzz in python 
Python :: seaborn modificar o tamanho dos graficos 
Python :: flatten list 
Python :: python tuple get index of element 
Python :: create requirements file and load it in new envirnment. 
Python :: pandas get highest values row 
Python :: Detect Word Then Send Message (discord.py) 
Python :: python list as queue 
Python :: pandas subplots 
Python :: how to import a class from a file to another python 
Python :: python tree 
Python :: python area calculator 
Python :: pass args and kwargs to funcitons 
Python :: if equal to key return value python 
Python :: test django migrations without applying them 
Python :: how to download file using python using progress bar 
Python :: binary to decimal python 
Python :: python split at index 
Python :: string concatenation in python 
Python :: python form html 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =