上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 44 下一页
摘要: python把函数作为参数 import math def add(x, y, f): return f(x) + f(y) print add(25, 9,math.sqrt) python中map()函数的应用。将首字母大写,其他的小写 def format_name(s): return s. 阅读全文
posted @ 2020-05-20 14:15 topass123 阅读(1163) 评论(0) 推荐(0) 编辑
摘要: 关键字lambda 表示匿名函数,冒号前面的 x 表示函数参数。 def is_not_empty(s): return s and len(s.strip()) > 0 filter(is_not_empty, ['test', None, '', 'str', ' ', 'END']) 修改为: 阅读全文
posted @ 2020-05-20 14:13 topass123 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1 ''' 2 time:2020/5 3 author:topass123 4 ''' 5 import sys 6 import time 7 for i in range(50): 8 sys.stdout.write("+")#此命令不会像print语句执行一次,换行一次\ 9 sys.st 阅读全文
posted @ 2020-05-19 16:22 topass123 阅读(113) 评论(0) 推荐(0) 编辑
摘要: bin目录的文件: #client #-*- Coding:utf-8 -*- import os,sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) #获取该项目根目录的完整路径 sys.path.a 阅读全文
posted @ 2020-05-19 15:22 topass123 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 先来一张图理解断点续传: 项目搭建: 服务端: #!/usr/bin/env python # -*- coding:utf-8 -*- """ 实现文件断点续传的服务器端 """ import socket import os BASE_DIR = os.path.dirname(os.path. 阅读全文
posted @ 2020-05-19 12:37 topass123 阅读(205) 评论(0) 推荐(0) 编辑
摘要: json.dumps()实现python类型转化为json字符串,返回一个str对象 ,把一个Python对象编码转换成Json字符串 ,如果直接将dict类型的数据写入json文件中会发生报错 import json import chardet listStr = [1, 2, 3, 4] tu 阅读全文
posted @ 2020-05-18 07:45 topass123 阅读(3329) 评论(0) 推荐(0) 编辑
摘要: AJAX = Asynchronous JavaScript and XML(异步的 JavaScript 和 XML)。 AJAX 不是新的编程语言,而是一种使用现有标准的新方法。 AJAX 是与服务器交换数据并更新部分网页的艺术,在不重新加载整个页面的情况下。 创建过程: function aj 阅读全文
posted @ 2020-05-16 10:27 topass123 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 1 共同点: 2 GET和POST是HTTP协议中的两种发送请求的方法。 3 HTTP是基于TCP/IP的关于数据如何在万维网中如何通信的协议。 4 GET和POST本质上就是TCP链接,并无差别。 不同点:1. GET在浏览器回退时是无害的,而POST会再次提交请求。 2. GET请求会被浏览器主 阅读全文
posted @ 2020-05-16 09:54 topass123 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#inter f0/0 Router(config-if)#ip ad Router(config-if)#ip addr 阅读全文
posted @ 2020-05-14 21:24 topass123 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 使用ospf协议建立如下图的实例,实现两个主机之间互通。 Switch(config)#hostna S560 S560(config)#vlan 10 S560(config-vlan)#vlan 20 S560(config-vlan)#inter f0/10 S560(config-if)#s 阅读全文
posted @ 2020-05-14 21:20 topass123 阅读(154) 评论(0) 推荐(0) 编辑
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 44 下一页