01 2023 档案
摘要:代码块 for index, ball in enumerate(balls): print(f'{ball:0>2d}', end=' ') if index == len(balls) - 2: print('|', end=' ') enumerate() enumerate()函数意为循环计
阅读全文
摘要:代码块 red_balls = [x for x in range(1, 34)] selected_balls = sample(red_balls, 6) selected_balls.sort() selected_balls.append(randint(1, 16)) return sel
阅读全文
摘要:代码块 response = requests.get(url=url, headers=headers, params=params) html = etree.HTML(response.text) python request库 requests.get()意为获取网页,对应HTTP中GET方
阅读全文
摘要:代码块 global fileName fileName = '{}.csv'.format(keyword) if not os.path.exists(fileName): with open(fileName, 'w+', encoding='utf-8-sig', newline='') a
阅读全文
摘要:场景 结果 通过阿里云oss直传签名上传文件时报错跨域。 查验 查看OSS资源中,发现通过配置方法直传后,文件实际是上传成功的。 思考与发现 说明这里只是浏览器报跨域错误。 解决办法 做法: ajax将withCredentials属性设置成false。 目的: 设置成跨域不带上cookie 原理可
阅读全文
摘要:layer 弹窗显示表格中的图片。 选用layer.photos 实例化 layer.photos({ photos: '#img_' + id, //0-6的选择,指定弹出图片动画类型,默认随机 anim: 5, }); bug 点击第一次不奏效,第二次点击出现了图片全宽显示在浏览器中。 结果是无
阅读全文