20161230 1922
今天看到的,網(wǎng)上的教學(xué)資料
https://launchschool.com/books

LaunchSchool

A Simple Web Server Greg Wilson -- 介紹如何用Python庫編寫一個簡單的Web服務(wù)器。

實驗樓-網(wǎng)上做實驗
https://www.shiyanlou.com/courses/running
This is a collection of sample scripts and tools for APIC-EM.-思科DevNet 使用Python庫調(diào)用APIC-EM API, 實現(xiàn)網(wǎng)絡(luò)設(shè)備自動化配置。(SDN)
我特別喜歡的一段代碼
Python Sample Notification Listener
import socket
import sys
# this listens to notification stream from MSE and displays results in console.
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Bind the socket to the address given on the command line
server_address = ('0.0.0.0', 8000) # change this to your ip address
sock.bind(server_address)
# print >>sys.stderr, 'using %s port %s' % sock.getsockname() # use this print statement for python2.7
print (sys.stderr,'using %s port %s' % sock.getsockname()) # use this print statement for python3
sock.listen(1)
while True:
print (sys.stderr, 'waiting for a connection') # use this print statement for python3
# print >>sys.stderr, 'waiting for a connection' # use this print statement for python2.7
connection, client_address = sock.accept()
try:
#print >>sys.stderr, 'client connected:', client_address # use this print statement for python2.7
print (sys.stderr, 'client connected:', client_address) # use this print statement for python3
while True:
data = connection.recv(1024) # change this value, based on your needs.
print (sys.stderr, 'received "%s"' % data) # use this print statement for python3
#print >>sys.stderr, 'received "%s"' % data # use this print statement for python2.7
if data:
connection.sendall(data)
else:
break
finally:
connection.close()
我特別喜歡的一段代碼
Python Sample Notification Listener -
URL:https://msesandbox.cisco.com:8081/apidocs/code