第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

使用字符串vs使用列表的subprocess.call

使用字符串vs使用列表的subprocess.call

動漫人物 2019-09-26 11:04:40
我正在嘗試將rsync與subprocess.call一起使用。奇怪的是,如果我傳遞subprocess.call一個(gè)字符串,它可以工作,但是它不能用于列表(ala,Python的文檔)。用字符串調(diào)用sp.call:In [23]: sp.call("rsync -av content/ writings_raw/", shell=True)sending incremental file list sent 6236 bytes  received 22 bytes  12516.00 bytes/sec total size is 324710  speedup is 51.89Out[23]: 0用列表調(diào)用sp.call:In [24]: sp.call(["rsync", "-av", "content/", "writings_raw/"], shell=True)rsync  version 3.0.9  protocol version 30Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others.Web site: http://rsync.samba.org/Capabilities:     64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,     socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,     append, ACLs, xattrs, iconv, symtimes rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are welcome to redistribute it under certain conditions.  See the GNUGeneral Public Licence for details.rsync is a file transfer program capable of efficient remote update via a fast differencing algorithm.Usage: rsync [OPTION]... SRC [SRC]... DEST  or   rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST  or   rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST  or   rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST  or   rsync [OPTION]... [USER@]HOST:SRC [DEST]   or   rsync [OPTION]... [USER@]HOST::SRC [DEST]   or   rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]The ':' usages connect via remote shell, while '::' & 'rsync://' usages connect to an rsync daemon, and require SRC or DEST to start with a module name.Options  -v, --verbose               increase verbosity -q, --quiet                 suppress non-error messages     --no-motd               suppress daemon-mode MOTD (see manpage caveat)... snipped....                              repeated: --filter='- .rsync-filter'      --exclude=PATTERN       exclude files matching PATTERN     --blocking-io           use blocking I/O for the remote shell -4, --ipv4                  prefer IPv4  -6, --ipv6                  prefer IPv6
查看完整描述

3 回答

?
德瑪西亞99

TA貢獻(xiàn)1770條經(jīng)驗(yàn) 獲得超3個(gè)贊

對我來說,使用shell = True并傳遞列表而不是字符串看起來是完全壞的,除非列表只有一個(gè)元素(即沒有參數(shù))。

查看完整回答
反對 回復(fù) 2019-09-26
?
叮當(dāng)貓咪

TA貢獻(xiàn)1776條經(jīng)驗(yàn) 獲得超12個(gè)贊

推薦的意思是“獲得最不令人驚訝的結(jié)果”。您可以執(zhí)行不建議的操作-代碼不會阻止您-結(jié)果將如我引用的摘錄中所述。

查看完整回答
反對 回復(fù) 2019-09-26
  • 3 回答
  • 0 關(guān)注
  • 392 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號