PlAwAnSaI
Administrator
External Resources:
Method of Procedure (MOP) Is Largely Manual
Do Less of...
Is Python considered Easy? HUH?
MANY OF THE CONCEPTS ARE THE SAME BUT THE SYNTAX IS EASIER IN PYTHON
C++:
- Network Transformation and Essential Skills for Next Generation Network Engineers
www.ciscolive.com/online/connect/sessionDetail.ww?SESSION_ID=92606
- Python Programming for Network Engineers
www.youtube.com/playlist?list=PLhfrWIlLOoKPn7T9FtvbOWX8GxgsFFNwn
- packetpushers.net/next-generation-network-engineers
- Is the CCIE Dead? Programming not Configuring Future IT
www.ciscolive.com/online/connect/sessionDetail.ww?SESSION_ID=94452
- learninglabs.cisco.com/tracks/programming-dna
Method of Procedure (MOP) Is Largely Manual
- Pre-maintenance Checks
+ Manually verify system state and readiness for MOP deployment
+ No way to track/predict an impact on the network: Will I violate my SLA?
- Maintenance
+ Node Cost out
+ Apply Software updates
+ Apply Configuration changes
+ Verity system state to ensure updates correctly deployed
+ Node Cost in
- Post Maintenance
+ Topology verification
+ Network state consistency check
- Time Consuming
- Expensive
- Error Prone
- Time Effective
- Low Cost
- Error Free
Do Less of...
- Device configurations
- Continuous operations
- Problem resolution
- Hardware deployments
- Monitoring and reporting
- CLI entries and scripting
- Hands-on repairs/deployments
- Service innovation
- Architectural (end-to-end) design
- Network analytics & optimization
- Programming - APIs versus CLI
- Software administration
- Comprehensive policy management
- Systems integration/validation
Is Python considered Easy? HUH?
MANY OF THE CONCEPTS ARE THE SAME BUT THE SYNTAX IS EASIER IN PYTHON
C++:
- #include stdout
int main()
{
std::count python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> "hello world"
'hello world'
>>> exit()
1. intro.py- print "hello world 2"
ython27>python intro.py
hello world 2Integer & Float:
Assigning Values to Variables:- counter = 100 # An integer assignment (10, 100, -786)
- miles = 1000.0 # A floating point (0.0, 15.20, -21.9)
- name = "John" # A string
- a = b = c = 1
- a, b, c = 1, 2, "john"
- del var
- del var_a, var_b
ython27>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> counter = 100
>>> counter
100
>>> anything=100
>>> anything
100
>>> miles = 1000.5
>>> miles
1000.5
>>> name = "John"
>>> name
'John'
>>> name = 'John155'
>>> name
'John155'>>> a=b=c =1
>>> a
1
>>> b
1
>>> c
1
>>> del a
>>> a
Traceback (most recent call last):
File "", line 1, in
NameError: name 'a' is not defined
>>> del b
>>> b
Traceback (most recent call last):
File "", line 1, in
NameError: name 'b' is not defined
>>> del c
>>> c
Traceback (most recent call last):
File "", line 1, in
NameError: name 'c' is not defined
>>> a,b,c = 1,2.8,'Jhon'
>>> a
1
>>> b
2.8
>>> c
'Jhon'
>>> exit()2. Ex.py- counter = 500
miles = 2000.15
name = 'Andrew'
print counter
print miles
print name
print counter, miles, name
print 'The counter value is: ', counter
ython27>python Ex.py
500
2000.15
Andrew
500 2000.15 Andrew
The counter value is: 500String:- str = 'Hello World!"
- print str # Prints a complete string
- print str[0] # Prints first character of the string
- print str[2:5] # Prints characters starting from 3rd to 5th
- print str[2:] # Prints string starting from 3rd character
- print str * 2 # Prints string two times
- print str + "TEST" # Prints concatenated string
ython27>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a
Traceback (most recent call last):
File "", line 1, in
NameError: name 'a' is not defined
>>> a = 'Some text'
>>> a = 'Chevy 427'
>>> a
'Chevy 427'
>>> a = 'Hello'
>>> b = 'World'
>>> a
'Hello'
>>> b
'World'
>>> c = a + b
>>> c
'HelloWorld'
>>> d = b + a
>>> d
'WorldHello'
>>> 50 + 30
80
>>> '50'+'30'
'5030'
>>> str = "Hello World"
>>> str
'Hello World'
>>> str[0]
'H'
>>> str[10]
'd'
>>> str[2:5]
'llo'
>>> str[2:8]
'llo Wo'
>>> str[:8]
'Hello Wo'
>>> str[2:]
'llo World'
>>> str[:]
'Hello World'
>>> str
'Hello World'
>>> new_string = "test "
>>> new_string
'test '
>>> new_string * 4
'test test test test '
>>> new_string + new_string
'test test '
>>> str= new_string * 4
>>> str
'test test test test '
>>> str= str + str
>>> str
'test test test test test test test test '3. Ex2.py- str = 'Hello World'
print str
first = str[:5]*4
next = str[6:]*3
print 'The first word is: ', first
print 'The next word is: ', next
ython27>python Ex2.py
Hello World
The first word is: HelloHelloHelloHello
The next word is: WorldWorldWorldLists:- list1 = ;
- list2 = [1, 2, 3, 4, 5, 6, 7 ];
- list3 = ["a", "b", "c", "d"];
- print "list1[0]: ", list1[0]
- print "list2[1:5]: ", list2[1:5]
- print "Value available at index 2 : "
- print list1[2]
- list1[2] = 2001;
- print "New value available at index 2 : "
- print list1[2]
- del list1[2];
- print "After deleting value at index 2 : "
- print list1
[1, 2, 3] + [4, 5, 6] = [1, 2, 3, 4, 5, 6] < Concatenation * 4 = < Repetition