From 58d6af3a27a3fb575498aa2755ae9af1b6283c32 Mon Sep 17 00:00:00 2001 From: chunlin Date: Wed, 8 Nov 2023 02:33:14 +0000 Subject: [PATCH] =?UTF-8?q?update=20src/toolService.py.=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=87=BD=E6=95=B0=E5=91=BD=E5=90=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chunlin --- src/toolService.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toolService.py b/src/toolService.py index bfde658..17f4726 100644 --- a/src/toolService.py +++ b/src/toolService.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- import time import os -import requests class ToolService: def prt_content(self, content): @@ -12,7 +11,7 @@ class ToolService: flags = '*' * 30 print(f"{flags}\n{content}\n{flags}") - def split_string_to_list(self, data): + def gen_list(self, data): """ 将字符串按行分割成列表。 """ @@ -64,6 +63,7 @@ class ToolService: """ 检查URL是否有效。 """ + import requests try: response = requests.get(url, stream=True) return response.status_code == 200 -- Gitee