By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,784 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

How do I write raspberrypi path

P: 1
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"

Expand|Select|Wrap|Line Numbers
  1. from tkFileDialog import askopenfilename
  2.     import paramiko
  3.  
  4.     client = paramiko.SSHClient()
  5.     client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  6.     client.connect('192.168.2.34', username='pi', password='raspberry')
  7.  
  8.     checkdir = "/home/pi/python"
  9.     name1= askopenfilename(title = "Select File For Removal", initialdir = checkdir)
  10.     stdin, stdout, stderr = client.exec_command('ls -l')
  11.     for line in stdout:
  12.        print '... ' + line.strip('\n')
  13.     client.close()
Feb 10 '15 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.