Python 提供了两个基本的 socket 模块:
Socket
它提供了标准的BSD Socket API。SocketServer
它提供了服务器重心,可以简化网络服务器的开发。
下面讲解下 Socket模块功能。
一 实验介绍 | |
本项目带领你学习用 C 语言实现 ping 命令。通过本项目中你可以更深入地理解 TCP/IP 协议,掌握 C 语言进行网络编程的技巧方法。 | |
1.1 知识点 | |
TCP/IP 协议介绍 | |
获取系统运行时间 | |
原始套接字 | |
1.2 效果截图 |
#!/bin/bash | |
#shows traffic on the specified device | |
function human_readable { | |
VALUE=$1 | |
BIGGIFIERS=( B K M G ) | |
CURRENT_BIGGIFIER=0 | |
while [ $VALUE -gt 10000 ] ;do | |
VALUE=$(($VALUE/1000)) |
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io" | |
"log" | |
) |
#!/usr/bin/env python | |
import sys | |
import pika | |
connection = pika.BlockingConnection(pika.ConnectionParameters( | |
'localhost')) | |
channel = connection.channel() | |
channel.queue_declare(queue='hello', durable=True) |
-- a quick LUA access script for nginx to check IP addresses against an | |
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
-- | |
-- allows for a common blacklist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- block an ip: | |
-- redis-cli SADD ip_blacklist 10.1.1.1 | |
-- remove an ip: |
原文:秦路
本文是《如何七周成为数据分析师》的第二十二篇教程,如果想要了解写作初衷,可以先行阅读七周指南。温馨提示:如果您已经熟悉Python,大可不必再看这篇文章,或只挑选部分。
大家学习Python,不练习怎么行?
这次依旧使用网络抓取的数据分析师的招聘薪资作为练习数据。在早期我们已经用它进行了Excel、BI可视化、SQL三方面的实战训练,想必大家已经很熟悉了,我不再赘述。
没有下载过的同学,后台发送「练习数据」获得链接。