rgfewfger

This commit is contained in:
27942
2025-12-08 16:38:40 +08:00
parent af1f98a87a
commit 3c82d117f2
2 changed files with 29 additions and 18 deletions

14
test.py
View File

@@ -6,12 +6,7 @@ class MyClass:
def start(self):
print("启动方法已执行")
def my_method(self):
print("指定的方法正在执行")
print(bfghsgrg)
# 模拟可能出现的错误
# 下面这行代码会触发一个异常,你可以根据需要注释掉它来测试正常情况
# result = 1 / 0
def end(self):
print("结束方法已执行")
@@ -22,6 +17,13 @@ class MyClass:
def __exit__(self, exc_type, exc_value, traceback):
self.end()
def my_method(self):
print("指定的方法正在执行")
print(bfghsgrg)
# 模拟可能出现的错误
# 下面这行代码会触发一个异常,你可以根据需要注释掉它来测试正常情况
# result = 1 / 0
# 使用 with 语句来调用这个类和方法
with MyClass() as obj:

View File

@@ -52,15 +52,6 @@ class Hub_Web:
self.xstart_info.start = 0
self.xstart_info.save()
def end(self):
self.page.quit()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.end()
def create_Browser(self):
if not self.xstart_info.bit_id:
@@ -545,6 +536,15 @@ class Hub_Web:
except:
pass
def end(self):
self.page.quit()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.end()
# def action(self):
@@ -652,6 +652,14 @@ class Hub_Web:
# self.page.quit()
def run_work(x_token_info, xstart_info):
# hun_web = Hub_Web(x_info=x_token_info, xstart_info=xstart_info)
# executor.submit(hun_web.to_do_tui)
with Hub_Web(x_info=x_token_info, xstart_info=xstart_info) as hub:
hub.to_do_tui() # 发推
if __name__ == '__main__':
# fz_datas = get_group_lists()
#
@@ -692,9 +700,10 @@ if __name__ == '__main__':
# if xstart_info.start:
# continue
hun_web = Hub_Web(x_info=x_token_info, xstart_info=xstart_info)
executor.submit(hun_web.to_do_tui)
# hun_web = Hub_Web(x_info=x_token_info, xstart_info=xstart_info)
#
# executor.submit(hun_web.to_do_tui)
executor.submit(run_work, x_token_info, xstart_info)
# time.sleep(random.randint(15, 60))
time.sleep(delay_between_start)