python fabric如何将\输入到代码分支中

python fabric如何将\输入到代码分支中,python,shell,fabric,Python,Shell,Fabric,我想使用结构控制我的远程主机 我想将结构输入shell命令行添加到代码分支 例如: shell代码: root@debian:~# cd /root 面料: con.run('cd /root') 我希望输入shell代码如下: root@debian:~# cd \ root@debian:~# /root 如何编写结构代码 我有一个带有长参数的shell命令,因此我需要使用列表理解对分支进行编码 lists = [['a','b'],['c','d','e']] print([j fo

我想使用结构控制我的远程主机

我想将结构输入shell命令行添加到代码分支

例如:

shell代码:

root@debian:~# cd /root
面料:

con.run('cd /root')
我希望输入shell代码如下:

root@debian:~# cd \
root@debian:~# /root
如何编写结构代码


我有一个带有长参数的shell命令,因此我需要使用列表理解对分支进行编码

lists = [['a','b'],['c','d','e']]
print([j for i in lists for j in i])
或者使用itertools

输出:

['a', 'b', 'c', 'd', 'e']
['a', 'b', 'c', 'd', 'e']