Skip to content

Instantly share code, notes, and snippets.

Created Apr 25, 2016
What would you like to do?
programmatic Junos set command generation, to eliminate tedious/manual repetitive policy creation
#!/usr/bin/env python3
basecommand = input('Enter base command, with "%" in place of iterables: ')
start = int(input('Enter range start (inclusive): '))
end = int(input('Enter range end (inclusive): '))
for i in range(start,end+1):
print(basecommand.replace("%", str(i)))
# print("\n%s" % basecommand)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment