|
1 | | -鍵盤與執行者 文件 |
| 1 | +Keyword & Executor |
2 | 2 | ---- |
3 | 3 |
|
4 | | -* Keyword 是一個 JSON 檔案裏面包含許多自定義的關鍵字與參數。 |
5 | | -* Keyword 會與 Executor 搭配使用。 |
6 | | -* Keyword 的格式是以下範例,且在 JSON 檔案裡面使用一樣格式。 |
| 4 | +Keyword is a JSON file that contains many custom keywords and parameters. |
| 5 | +Keywords are used in conjunction with the Executor. |
| 6 | +The format of a keyword is as shown in the following example, and the same format is used in the JSON file. |
7 | 7 |
|
8 | 8 | .. code-block:: python |
9 | 9 |
|
|
16 | 16 | ["function_name_in_event_dict": {param_value1, param_value2....}] |
17 | 17 | ] |
18 | 18 |
|
19 | | -如果我們想要在 executor 裡面添加 function,可以使用如下: |
20 | | -這段程式碼會把所有 time module 的 builtin, function, method, class |
21 | | -載入到 executor,然後要使用被載入的 function 需要使用 package_function 名稱, |
22 | | -例如 time.sleep 會變成 time_sleep |
| 19 | +The executor is an interpreter that can parse JSON files and execute automation scripts. |
| 20 | +It can be easily transferred over the network to a remote server or computer, |
| 21 | +which can then execute the automation scripts using the executor. |
| 22 | + |
| 23 | +If we want to add a function to the executor, we can use the following code snippet. |
| 24 | +This code will load all the built-in functions, methods, and classes of the time module into the executor. |
| 25 | +To use the loaded functions, we need to use the package_function name, for example, time.sleep will become time_sleep. |
23 | 26 |
|
24 | 27 | .. code-block:: python |
25 | 28 |
|
|
28 | 31 |
|
29 | 32 |
|
30 | 33 |
|
31 | | -如果你需要查看被更新的 event_dict 可以使用 |
| 34 | +If you need to check the updated event_dict, you can use: |
32 | 35 |
|
33 | 36 | .. code-block:: python |
34 | 37 |
|
35 | 38 | from je_auto_control import executor |
36 | 39 | print(executor.event_dict) |
37 | 40 |
|
38 | | -如果我們想要執行 JSON 檔案 |
| 41 | +If we want to execute a JSON file |
39 | 42 |
|
40 | 43 | .. code-block:: python |
41 | 44 |
|
42 | 45 | from je_auto_control import execute_action, read_action_json |
43 | 46 | execute_action(read_action_json(file_path)) |
44 | 47 |
|
45 | | -如果我們想要執行資料夾裡所有 JSON 檔案 |
| 48 | +If we want to execute all JSON files in a folder, we can use the following code snippet: |
46 | 49 |
|
47 | 50 | .. code-block:: python |
48 | 51 |
|
|
0 commit comments