10 2019 档案
摘要:f = open("1.txt",encoding = 'utf-8') data = f.read() print(date) 注意:open函数是按照操作系统来读取文件的,windows一般是gbk格式存数据,而如果文件是gbk格式,那么就不用指定字符编码; 执行程序,先将代码送到内存中,而为什
阅读全文
摘要:https://www.cnblogs.com/nickjiang/p/9148136.html https://www.cnblogs.com/8023-CHD/p/11067141.html 一 .session和cookie产生的原因 HTTP协议是无状态的协议。一旦数据交换完毕,客户端与服务
阅读全文
摘要:1.用拉链函数zip()将字典转换成元组对!函数中的两个参数必须是序列!p = {'name':'zhangsanfeng','age':18,'gender':'nan'}print(list(zip(p.keys(),p.values())))>>>[('name', 'zhangsanfeng
阅读全文
摘要:什么样的函数叫高阶函数: 条件:1.函数接受函数作为参数 2.函数的返回值中包含函数高阶函数之 map函数 map(func, *iterables) --> map objectnum_l = [1,2,3,4,5,6]b = map(lambda x:x**2,num_l)print(b)for
阅读全文
摘要:什么样的函数叫高阶函数:map(func, *iterables) --> map object 条件:1.函数接受函数作为参数 2.函数的返回值中包含函数 num_l = [1,2,3,4,5,6]b = map(lambda x:x**2,num_l)print(b)for i in b: pr
阅读全文
摘要:def foo(): print("foo",id(foo)) def bar(): print("bar",id(bar)) def inner(): print("inner",id(inner)) return inner return barprint(id(foo))bar = foo()
阅读全文
摘要:用法:dict.update(dict2)dict立即改变!返回值是Nonea = {'a':1,'b':2,'c':3}b = {'d':4,'e':5}a.update(b)print(a)update方法的返回值是None,a立即改变了>>>{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}a = {'a':1,'b':2,'c':3}
阅读全文
摘要:db = {} path = [] while True: temp = db for item in path: temp = temp[item] print('当前节点的所有可选子节点:',list(temp.keys()),'\n') choice = input("1:添加节点;2:查看节点(Q退出/B返回上一级) \n>>>") if choice == "1": k = input(
阅读全文
摘要:Redhat6.5安装oracle11g 一、 安装环境 linux服务器:Redhat 6.5 64位 oracle版本:oracle11gR2 远程windows服务器:已安装Xmanager 内存:8G 存储空间:1T 二、 安装前系统设置 1、软连接lib库:ln -s /lib/libc.
阅读全文
摘要:1、join方法:拼接字符串 >stra = "你是风儿我是沙"b = "@".join(a)print(b)>>>你@是@风@儿@我@是@沙2、strip方法:处理左右空格、\t、\n >str 还可以处理指定内容a.strip("x") a.lstrip a.rstrip()a = " Hell
阅读全文
摘要:continue:表示终止当前循环,开始下一次循环 break:终止所有循环
阅读全文