How do I write raspberrypi path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fahadkalis
    New Member
    • Feb 2015
    • 1

    How do I write raspberrypi path

    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"

    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()
    Last edited by fahadkalis; Feb 10 '15, 06:38 PM. Reason: main points visible
Working...