摘要: 我们来看一下,假设A检测到网络是空闲的,开始发数据包,尽力传输,当数据包还没有到达B时,B也监测到网络是空闲的,开始发数据包,这时就会发生碰撞,B首先发现发生碰撞,开始发送碰撞信号,所谓碰撞信号,就是连续的01010101或者10101010,十六进制就是55或AA。这个碰撞信号会返回到A,如果碰撞 阅读全文
posted @ 2018-07-24 15:00 leon-zyl 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 1 #author:leon 2 data = { 3 '北京':{ 4 '昌平':{ 5 "沙河":["oldboy","test"], 6 "天通苑":["链家","我爱我家"] 7 }, 8 '朝阳':{ 9 "望京":["奔驰","陌陌"], ... 阅读全文
posted @ 2018-02-09 09:22 leon-zyl 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1 #author:leon 2 product_list= [ 3 ('iphone',5800), 4 ('mac pro',9800), 5 ('bike',800), 6 ('watch',6000), 7 ('coffee',31), 8 ('book',120) 9 ] 10 shopping_list= [] 11 ... 阅读全文
posted @ 2018-02-09 09:19 leon-zyl 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 1、可利用linux自带下载工具wget下载,如下所示:( 笔者安装的是最小centos系统,所以使用编译命令前,必须安装wget服务,读者如果安装的是界面centos系统,或者使用过编译工具则可跳过安装wget,直接进行下边的编译步骤 ) 1、可利用linux自带下载工具wget下载,如下所示:( 阅读全文
posted @ 2018-02-06 15:46 leon-zyl 阅读(29186) 评论(2) 推荐(3) 编辑
摘要: 1 #author:leon 2 #"hello world!" 3 4 for i in range(10): #循环十次,每一次循环赋一个0-9中的数字给i 。 5 print("-------",i) 1 for i in range(2,8,2): #循环八次,从2-8,间隔(步幅)为2 。 2 print("-------",i) ... 阅读全文
posted @ 2018-02-03 16:43 leon-zyl 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 import getpass #加密密码 2 username = input("username:") 3 password = getpass.getpass("password:") 4 print(username,password)此代码在pycharm中执行打印出现异常,放到dos窗 阅读全文
posted @ 2018-02-03 15:54 leon-zyl 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 打印结果: 当输入正确的用户名密码时: 当输入错误的用户名密码时: 阅读全文
posted @ 2018-02-03 15:45 leon-zyl 阅读(1491) 评论(0) 推荐(0) 编辑
摘要: 打印结果: 阅读全文
posted @ 2018-02-03 15:38 leon-zyl 阅读(248) 评论(0) 推荐(0) 编辑
摘要: # Author:leon production_list = [ ('iphone',5800), ('mac pro', 9800), ('bike', 800), ('watch', 10600), ('coffee', 31), ('alex python', 120) ] shopping_list=[] ... 阅读全文
posted @ 2017-09-18 12:38 leon-zyl 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #Author:zyl age_of_oldboy = 56 count = 0 while count age_of_oldboy : print("think smaller") else: print("think bigger!") count +=1 if count ==3: countine_confi... 阅读全文
posted @ 2017-09-18 12:33 leon-zyl 阅读(148) 评论(0) 推荐(0) 编辑