From the course: Python Theory for Network Engineers
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Solution: Making your script do repeatable tasks - Python Tutorial
From the course: Python Theory for Network Engineers
Solution: Making your script do repeatable tasks
(upbeat music) - [Man] All right, hope that wasn't too bad, because this operation, if you remember, this requires us to have on the Nexus OS device. So in my lab, I only have two devices that are in Nexus. So therefore, my devices are, this is the LAX Core R-1, this is NYC Core R-1. And therefore, my device list would consist of these two devices. Whereas in if you have iOS device, or if you choose to use iOS device from Netmiko, then you could take that block of code, and your device list is list out to be the edge devices within the data center, right? But in this case, I'm using just the Nexus OS. So that is my device list, http, 2.50, 2.60, and the way that I could loop through that device list is the same thing as for device in device list. And remember, indentation matters, right? So, the block of code that we want to execute together all have the same indentation. And for Python, the common practice, I want…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Conditional logic: If/then and compare values2m 49s
-
(Locked)
Lab: Demonstrating if/then and value comparison3m 4s
-
(Locked)
Conditional logic: For and while loops2m 47s
-
(Locked)
Lab: Demonstrate for and while loops5m 4s
-
(Locked)
Challenge: Making your script do repeatable tasks1m 4s
-
(Locked)
Solution: Making your script do repeatable tasks2m 19s
-
-
-
-