I writing a program in python on ubuntu, to remove a file by accessing RaspberryPi, connected with network.
For file selection I am using a command called askopenfilename.
But I am struggling in specifying the Path of RaspberryPi.
IP ="192.168.2. 34"
Username = "pi"
Password ="raspberry"
Path="/home/pi/python"
For file selection I am using a command called askopenfilename.
But I am struggling in specifying the Path of RaspberryPi.
IP ="192.168.2. 34"
Username = "pi"
Password ="raspberry"
Path="/home/pi/python"
Code:
from tkFileDialog import askopenfilename
import paramiko
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('192.168.2.34', username='pi', password='raspberry')
checkdir = "/home/pi/python"
name1= askopenfilename(title = "Select File For Removal", initialdir = checkdir)
stdin, stdout, stderr = client.exec_command('ls -l')
for line in stdout:
print '... ' + line.strip('\n')
client.close()