Python
随便写点
Forever_lee_Ay
生活就像海洋,只有意志坚强的人才能到彼岸。简简单单,律己从严!共勉!!
展开
-
traceback追踪异常
使用 traceback 模块追踪异常 示例如下 import traceback try: # error code except Exception as e: current_app.logger.info(traceback.format_exc())原创 2020-08-20 17:01:32 · 196 阅读 · 0 评论 -
Python二分查找
二分查找简单实现 闲来无事,写个二分查找demo,代码简单,自己体会哟。 def binary_search(arr, no): mid = len(arr)//2 if len(arr) == 1 and arr[mid] != no: print("亲,你找的数字%s不在列表里" % no) return if len(arr) &l...原创 2020-04-18 23:21:33 · 121 阅读 · 0 评论 -
Python Spider demo
Python实现的一个小爬虫 记录一个Python实现的Spider,下面是demo示例 import time import requests from bs4 import BeautifulSoup import os class Mztu(object): def __init__(self, start_url, headers, save_path, start_no...原创 2020-04-11 21:24:23 · 205 阅读 · 0 评论