如何编写树莓路径

我在ubuntu上用python语言编写了一个程序,通过访问连接到网络的RaspberryPI来删除文件。
对于文件选择,我使用了一个名为
AskOpenFileName

但我正在努力指明RaspberryPI的道路。
IP="192.168.2.34"
用户名="pi"
密码="覆盆子"
PATH="/home/pi/python"

选择 | 换行 | 行号
  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()

标签: python

添加新评论