python--自用复习
本帖最后由 Linmc03 于 2020-7-23 16:02 编辑https://static.52pojie.cn/static/image/hrline/5.gif
#-*- coding:UTF-8 -*-
############################
## 复制文件至目标文件夹 ##
############################
import shutil
import os
file='./test.py' # file which needs to be copied
target='./countContactNum' # target folder
shutil.copy(file,target)
https://static.52pojie.cn/static/image/hrline/5.gif
##################################
#### 分类两个list中重复/不同元素 ####
##################################
#for examplelist1=[1,2,3
list2=[2,3,6,8
r=[]# relative to list1, repeated items
l=[]# relative to list1, lost items
n=[]# relative to list1, new items
r=for x in list1 if x in
l=for y in list1 if y not in
n=for z in list2 if z not in
页:
[1]