Good morning/evening,
I'm configuring 3 cisco switches using netmiko which is an automation python library for networking .I have the cisco configuration lines saved in the file called "IOS_config". and I have 3 switches defined in a list called "all_devices". I'm adding IOS_config configuration in each switch. I'm trying to add a loading bar using tqdm library to know how long it takes for each switch to be configured as shown below.
with open('IOS_Image') as f:
lines = f.read().splitlines()
print (lines)
all_devices = [S1, S2, S3]
for devices in tqdm(all_devices,desc="Loading...",):
print("configuring..." + devices['ip'] )
net_connect = ConnectHandler(**devices)
output = net_connect.send_config_set(lines)`
The issue is that tdqm has 33% step. Meaning while configuring S1, loading bar is showing 0%. When finishing S1 and going to S2, it jumps to 33% without a continuous gradual increase . I want know if there is a method with or without tqdm libray where I can see the progress while configuring each switch with a gradual increase. Thanks
You can iterate through each command to display a more granular progress bar. In the following example, the progress bar has 9 steps instead of 3.