[python]Capture return values after threads are finished.

Return value lost after threads finished I have made two functions: The jinja template for preparing the object network {name} command: Then I create a test code to push multiple object network {name} commands to a single cisco asa - fw02. To achieve concurrency I use the threading.Thread module, however my return value of send_net_objs_to_asa_host … Continue reading [python]Capture return values after threads are finished.

Advertisement

[python]Comparing executed time between with and without threading

To compare between with and without threading, there are three routers from R1 to R3, the task is to save the show version on each router to all.txt. Do the tasks without threading The script runs sequentially on each device, and the total time is 15seconds. Do the tasks with threading The time taken to … Continue reading [python]Comparing executed time between with and without threading

[python]Multiprocess and multithreading for port scan version 3

Background This is an upgrade scripts to check for open ports on every addresses found in subnets. The upgrade uses Processpoolexecutor, a minor re-write uses the processpoolexecutor and theadpoolexecutor together. network_discovery.py - obtains directly connected subnets scanner.py This script does the port scanning based on the subnets obtained from network_discovery.py. start_now.py - main script to … Continue reading [python]Multiprocess and multithreading for port scan version 3

[python]Multithreading to scan for port status version 2

Background this is a follow up of this post, on that previous post, threading printed the results however i had problems with getting the returned value from the function which the thread was running, lama4ok suggested in his comment to use concurrent.futures, well his suggestion does work, so now I can get the actual returned … Continue reading [python]Multithreading to scan for port status version 2