无法在此python代码中放入多线程逻辑

时间:2017-12-25 20:19:52

标签: python multithreading python-2.7 networking scp

有没有办法在这里使用多线程,因此如果创建了4个节点,文件将并行发送到4个节点。

#!/usr/bin/python2

import os

x = raw_input("Enter no. of nodes you want to create: ")
print "\nEnter ip as follows -- 1 192.168.0.1 \n"
d = dict(raw_input().split() for _ in range(int(x)))

for i in d:
    os.system("sshpass -p 'abc@abc' scp /root/Desktop/abc.py root@" + d[i] 
+":/root/Desktop/md/")
    print "configured successfully " + i

提前致谢

0 个答案:

没有答案