我使用Pyhton paramiko和我的网站服务器有像这样的文件夹结构 –
1]dir1 --dirP --dirQ 2]dir2 --dirA --file.sh --dirB 3]dir3
我想从dir2里面的dir2文件夹访问file.sh
我试过这个 –
import paramiko client.connect('mysite.com',username='something',password='something') stdin,stdout,stderr = client.exec_command('cd dir2') stdin,stderr = client.exec_command('ls') for line in stdout: print('... ' + line.strip('n'))
但我得到输出 –
服务启动时的DLL加载顺序
DLL从其父(符号)获取符号
通过程序集以编程方式检测上下文切换
将文件扩展名关联到python脚本,以便我可以在Windows中双击打开文件
...dir1 ...dir2 ...dir3
预期产出是 –
...dirA ...dirB
也build议如何执行file.sh呢?
服务错误1053:无法及时启动
当exe失败时,python popen sdtout不会得到所有的输出
(Windows API)WM_PAINT鼠标问题
哪个DVCS在我的场景下最适合Windows?
无法追踪潜在的内存覆盖。 Windows奇怪
client.exec_command("cmd ...")就像命令ssh user@host "cmd ..."
client.exec_command('cd dir2') client.exec_command('ls')
就像
ssh user@host 'cd dir2' # this would not affect the following `ls' ssh user@host 'ls'
。 所以你需要这样做:
client.exec_command('cd dir2; ls')
这就像
ssh user@host 'cd dir2; ls'
或者如果你使用变量需要添加+例如
client.exec_command('str(var1)+str(var2))
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。