WebLinuxStudy

导航

 
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 20 下一页

2021年3月17日

摘要: 将/data/aDir/文件夹下的bDir文件夹,打包到/tmp/cDir/文件夹下,起名为dTest.tar.gz cd /data/aDir # 查大小du -h --max-depth=0 bDir tar -czf /tmp/cDir/dTest.tar.gz bDir 阅读全文
posted @ 2021-03-17 18:15 WebLinuxStudy 阅读(45) 评论(0) 推荐(0) 编辑
 

2021年3月8日

摘要: python使用xpath获取内容 <div class="leftbox"> <div class="panel"> <div class="mtitle path"><h1>12</h1></div> <div class="mcon1"><h2>34</h2></div> <div class 阅读全文
posted @ 2021-03-08 22:07 WebLinuxStudy 阅读(1566) 评论(0) 推荐(0) 编辑
 

2021年3月5日

摘要: 测试所用的编辑器:notepad++ ^(\s*)\r\n 根据文档格式(windows, mac, linux行尾符)不同 将其中的\r\n替换成不同行尾符 windows: ^(\s*)\r\n linux: ^(\s*)\n mac: ^(\s*)\n (mac 也是一种类linux系统) 阅读全文
posted @ 2021-03-05 20:49 WebLinuxStudy 阅读(468) 评论(0) 推荐(0) 编辑
 

2021年2月7日

摘要: list1 = [1,2,1,3] list1 = list(set(list1)) print(list1) 阅读全文
posted @ 2021-02-07 16:06 WebLinuxStudy 阅读(41) 评论(0) 推荐(0) 编辑
 
摘要: list1 = [1,2,3,4] str = ','.join('"{0}"'.format(x) for x in list1) print(str) 阅读全文
posted @ 2021-02-07 16:00 WebLinuxStudy 阅读(1115) 评论(0) 推荐(0) 编辑
 
摘要: 用python读取Excel中的日期字符串,结果为5位数字,如何将5位数字转换为对应的日期? import time # 格式化为时间元组timeArray = time.localtime((5位数字-25569) * 86400.0)# 将时间元组转换为时间字符串timeStr = time.s 阅读全文
posted @ 2021-02-07 15:55 WebLinuxStudy 阅读(1881) 评论(0) 推荐(1) 编辑
 
摘要: import time year = 2020month = 1day = 20 dateStr = "{}-{}-{}".format(year, month, day)print(dateStr) # 时间字符串解析为时间元组timeArray = time.strptime(dateStr, 阅读全文
posted @ 2021-02-07 15:28 WebLinuxStudy 阅读(876) 评论(0) 推荐(0) 编辑
 

2020年10月26日

摘要: //需要单双引号转移的字符串$content = '需要单双引号转移的"字符串"';if (!get_magic_quotes_gpc()) { $content = addslashes($content);} 阅读全文
posted @ 2020-10-26 11:24 WebLinuxStudy 阅读(340) 评论(0) 推荐(0) 编辑
 

2020年10月23日

摘要: 例如: <a style="color:#ccc; font-size=14px;" href="http://baidu.com">百度</a>将字符串中style="color:#ccc; font-size=14px;"替换掉 <?php$string = '<a style="color:# 阅读全文
posted @ 2020-10-23 15:56 WebLinuxStudy 阅读(393) 评论(0) 推荐(0) 编辑
 

2020年10月16日

摘要: 批量插入,存在则修改,不存在则插入 INSERT INTO 表名 (字段1, 字段2, 字段3, 字段4) VALUES (字段1值, 字段2值, 字段3值, 字段4值) ON DUPLICATE KEY UPDATE 存在时需要修改的字段 = 字段值; 如果在INSERT语句末尾指定了ON DUP 阅读全文
posted @ 2020-10-16 14:25 WebLinuxStudy 阅读(1161) 评论(0) 推荐(0) 编辑
 
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 20 下一页