Skip to content

Instantly share code, notes, and snippets.

Created April 25, 2016 23:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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