08 2022 档案
摘要:2种方式: 【不删除给定的目录】 path1 = "D:\\dev\\workspace\\python\\pytestDemo\\222" def del_filedir(path): for file in os.listdir(path): res = os.path.join(path, f
阅读全文
摘要:import random a = {'lab-1': '短视频', 'lab-1': '直播'} print(random.choice(list(a.keys()))) # 从keys的list中随机返回一个元素 print(random.choice(list(a.values()))) #
阅读全文
摘要:import random idList = ['11', '22', '23', '34', '35', '14', '45', '66', '88', ] def get_randomID(): "返回一个字符串" if len(idList) == 0: print("idList中没有数据,
阅读全文
摘要:a = -1 # int b = 2.0 # float c = 13.11 # float d = 3.14j # complex print(type(a), type(b), type(c), type(d)) print(a + c) # 加:10.11 print(a - c) # 减:-
阅读全文