Reputation: 479
How do I run this SSH on a python script?
ssh [email protected] 'DISPLAY=:0 notify-send "Title" "Description"'
My python script will ask for a raw_input() for the Title
, and another one for the Description
. Then the python will run the SSH inserting the Title
and Description
typed by the user.
Upvotes: 0
Views: 580
Reputation: 126
If you're going to want a little more control, you should also check out the paramiko library: https://github.com/paramiko/paramiko It's an SSH2 library for python.
Upvotes: 1
Reputation: 3472
import subprocess
subprocess.check_call(
'''ssh [email protected] 'DISPLAY=:0 notify-send "{0}" "{1}"' '''.format(title, description),
shell=True)
Upvotes: 2