1
cdxem713 Oct 15, 2015 via iPhone
' '.join(['awk', '{print $1}', 'file'])
是这意思么? |
3
xvid73 Oct 15, 2015
>>> ' '.join(['awk', "'{print $1}'", 'file'])
"awk '{print $1}' file" 是这个意思么?运行命令的话有 subprocess 模块。 |
4
paw Oct 15, 2015
py 里面 ' 和 " 都可以括字符串的 " ' " ' " ' 都行。。
' \' ' 转意下 也可以的 |
5
xufang Oct 15, 2015 via Android
第三方 sh 模块
|
7
rundis Oct 16, 2015 via iPhone
import os
cmd = ' '.join(aList) os.system(cmd) |
8
youkeshen Oct 16, 2015
试试 Plumbum
|
10
aec4d Oct 16, 2015
os.system(' '.join(['awk', "'{print $1}'", 'file'])) 应该可以
subprocess.Popen 有时会有 bug 遇到过 |
11
aec4d Oct 19, 2015 " ".join(pipes.quote(s) for s in strings)
|