Source Code for network and port scanner, TRW algorithm, and reduction method implementations.

trial_map.py 600B

123456789101112131415161718192021222324
  1. #Trial program to practice using Pool class
  2. import multiprocessing as mp
  3. process_num = 8
  4. pool = mp.Pool(processes=process_num)
  5. files1 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]
  6. files_list = []
  7. quenepas_blocksize = len(files1) / process_num
  8. for x in range(process_num):
  9. files_list.append(files1[0:quenepas_blocksize])
  10. files1 = files1[quenepas_blocksize:]
  11. print files1
  12. print len(files1)
  13. print files_list
  14. for i in files1:
  15. print files1.index(i)
  16. print i
  17. files_list[files1.index(i)].append(i)
  18. print files1
  19. print files_list