摘要: findall 的捕获分组与非捕获分组 # -*- coding:utf-8 -* import re str1 = 'fdg@163.com abc@qq.com' reg_str1=r'([0-9a-zA-Z_]+)+@'# 打印结果 ['fdg', 'abc'] #reg_str1=r'(?: 阅读全文
posted @ 2020-02-14 12:35 努力奋斗小青年 阅读(748) 评论(0) 推荐(0) 编辑
摘要: 要确定计算机的IP是静态IP还是动态IP,请执行以下步骤: 通过单击开始打开命令提示符并搜索CMD,然后单击cmd.exe 键入ipconfig / all。 找到“以太网本地连接”列表。找到“ IP地址”行,这将为您提供当前分配的IP地址。接下来,在同一部分中查看“ DHCP Enabled”行。 阅读全文
posted @ 2019-11-11 18:14 努力奋斗小青年 阅读(5236) 评论(0) 推荐(0) 编辑
摘要: int m=2, n=2;//行数和列数 pattern = (char**)malloc(sizeof(char*)*m);//申请一组一维指针空间。 for (int i = 0; i<m; i++) pattern[i] = (char*)malloc(sizeof(char)*n);//对于 阅读全文
posted @ 2019-09-30 10:18 努力奋斗小青年 阅读(4493) 评论(0) 推荐(0) 编辑
摘要: #If Vba7 Then #如果是运行在64位office上 Declare PtrSafe Sub...#Else #如果是运行在32位office上 Declare Sub...#EndIf 在Visual Basic中,在定义通用过程时,如果形参前面有关键字ByVal,则该参数用传值方式传送 阅读全文
posted @ 2019-07-09 18:17 努力奋斗小青年 阅读(250) 评论(0) 推荐(0) 编辑
摘要: python读取txt文件 1、错误一 with open(path,'r') as f: for line in f: line = line.strip() # # 报错: UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in pos 阅读全文
posted @ 2019-06-27 18:40 努力奋斗小青年 阅读(984) 评论(0) 推荐(0) 编辑
摘要: # -*- coding:utf-8 -*- setData=set([]) #第一种方式,通过add()添加元素 setData.add('china\n') setData.add('turky\n') print(setData) #set(['turky\n', 'china\n']) se 阅读全文
posted @ 2019-05-21 14:32 努力奋斗小青年 阅读(2422) 评论(0) 推荐(0) 编辑
摘要: python2将一个字符串写入文件中: 1、如果字符串是str类型 # -*- coding:utf-8 -*- txtFile="今天天气不错" f = open("1.txt", "wb") f.write(txtFile) f.close() 2、如果字符串是unicode类型 # -*- c 阅读全文
posted @ 2019-05-15 17:12 努力奋斗小青年 阅读(2434) 评论(0) 推荐(1) 编辑
摘要: 一、获得邮箱地址 (?:xxx)为非捕获分组 # -*- coding:utf-8 -* import re str1 = 'fdg.lll.pp123@163.com hdfh.abc@qq.com hidfsd@qq.com.com gfgfa@qq.com bdfdg@163.com' reg 阅读全文
posted @ 2019-05-15 14:14 努力奋斗小青年 阅读(12319) 评论(0) 推荐(0) 编辑
摘要: # -*- coding:utf-8 -*- import xlrd path = u"C:\\读取表格\\表格.xls"# workbook = xlrd.open_workbook(path) sheet = workbook.sheet_by_index(0) for row in range 阅读全文
posted @ 2019-05-14 18:42 努力奋斗小青年 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 对比 返回值类型 返回值 re.search 返回一个对象。使用group()获得匹配的值,该值为str类型。 返回第一个成功的匹配 re.findall 返回一个列表。列表中包含所有满足条件的结果。 所匹配的所有子串 re.search 扫描整个字符串并返回第一个成功的匹配。 # -*- codi 阅读全文
posted @ 2019-05-14 18:39 努力奋斗小青年 阅读(6510) 评论(0) 推荐(0) 编辑