MCPcopy Create free account
hub / github.com/a943512/PyAibote / script_main

Method script_main

test_windows.py:24–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 # 2.3. 注意:script_main 此方法是脚本执行入口必须存在此方法
23 # 2.3. Note: script_main This method must exist in the script execution portal.
24 def script_main(self):
25
26 # 查询所有窗口句柄
27 result = self.find_windows()
28 print(result)
29
30
31
32
33
34 # 主函数死循环时win驱动连接断开异常捕获跳出死循环demo示例代码
35 # while True:
36 # try:
37 # # 死循环中必须加入aibote函数代码
38 # result = self.find_windows()
39 # print("我是个死循环")
40 # time.sleep(2)
41
42 # # 服务端捕获客户端断开异常跳出线程循环结束连接
43 # except OSError as e:
44 # break
45
46 # # 捕获其他非连接断开异常
47 # except Exception as e:
48 # print(e)
49
50
51
52 # 关闭驱动 方法一 终端命令杀死驱动
53 # self.close_driver_local()
54
55 # 关闭驱动 方法二 驱动自动断开连接
56 # self.close_driver()
57
58 # 关闭驱动 方法三 终端命令杀死驱动
59 # os.popen('taskkill /f /t /im "WindowsDriver.exe"')
60
61 # 关闭驱动 方法四 cmd终端直接输入杀死驱动
62 # taskkill /f /t /im "WindowsDriver.exe"
63
64
65

Callers

nothing calls this directly

Calls 1

find_windowsMethod · 0.80

Tested by

no test coverage detected