从subprocess.call捕获Whois输出

时间:2018-07-30 15:11:13

标签: python-2.7 docker whois

我正在尝试使用subprocess.call从docker容器内的python脚本进行的whois调用捕获输出。我尝试使用Popen和check_output,但是它们会引发错误。这是代码:

import glob

files = glob.glob(r'my_dir/trj_00*/file.txt')
blackList = ['trj0005', 'trj0009', 'trj0011', 'trj0056', 'trj0083']
files = [f for f in files if all(bl not in f for bl in blackList)]

print(files)

0 个答案:

没有答案