From 3e41a90ac6f41175b97e9c0be55020057825640c Mon Sep 17 00:00:00 2001 From: wkyuu Date: Sun, 24 Apr 2022 11:53:36 +0800 Subject: [PATCH] Bug fix --- README.md | 5 +++++ view.py | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 79d9ad2..81f9fc6 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,11 @@ redisconn = redis.Redis(host = '127.0.0.1', port = '6379', password = 'x', db = 在使用线程池的情况下,完整跑完 1500条数据,用时544秒 + + +- 目前已知问题 + - 在非windows环境下,打开可视化界面时会找不到字体,解决方法是修改 settings.py 中的字体为自己当前操作系统所有的字体。使用view.py中的getFont方法能列出当前系统所有的字体。 + ## 参考链接 1,[selenium+python自动化100-centos上搭建selenium启动chrome浏览器headless无界面模式](https://www.cnblogs.com/yoyoketang/p/11582012.html) diff --git a/view.py b/view.py index f3f6dd9..27f65e8 100644 --- a/view.py +++ b/view.py @@ -76,11 +76,14 @@ class view: def listCatalogues(): path = r"./Catalogues/" + if not os.path.exists(path): + print("当前目录[{}]下没有数据!".format(path)) + return False, None, None dirList = os.listdir(path) fileList = [] for filename in dirList: fileList.append(path + filename) - return len(fileList), fileList + return True, len(fileList), fileList def getData(filename, catalogue): while True: @@ -145,8 +148,8 @@ def getData(filename, catalogue): else: print("无效选项!") def main(): - length, fileList = listCatalogues() - while True: + check, length, fileList = listCatalogues() + while check: print("检测到当前缓存中共有{}个目录:".format(length)) case = {} for i in range(length):