摘要:from urllib.request import urlopenfrom bs4 import BeautifulSoupimport reimport randomimport datetimepages = set()random.seed(datetime.datetime.now())d
阅读全文
摘要:"""A TestRunner for use with the Python unit testing framework. Itgenerates a HTML report to show the result at a glance.The simplest way to use this
阅读全文
摘要:1、建立连接2、创建游标3、执行sql4、获取数据5、关闭数据库# coding:utf8import sysimport oscurPath = os.path.abspath(os.path.dirname(__file__))rootPath = os.path.split(curPath)[
阅读全文
摘要:# -*- coding:utf-8 -*-import osimport configparserimport codecsimport jsonproDir = os.path.split(os.path.realpath(__file__))[0]configPath = os.path.jo
阅读全文
摘要:1、os模块与sys模块的区别 os模块负责程序与操作系统的交互,提供了访问操作系统底层的接口 sys模块负责程序与python解释器的交互,提供了一系列的函数和变量,用于操控python的运行时环境 2、os.path.realpath(__file__)与os.getcwd()的区别 os.pa
阅读全文
摘要:1、创建句柄 2、句柄添加格式化输出 3、句柄添加报警级别 4、logger添加句柄
阅读全文