You can develop, debug, and run Python scripts online. The developed scripts can be run in jobs. For details, see Developing a Job.
Prerequisites
- A Python script has been added. For details, see Creating a Script.
- A host connection has been created. The host is used to execute Python scripts. For details about how to create a host connection, see Table 11.
- You have locked the script. Otherwise, you must click Lock so that you can develop the script. A script you create or import is locked by you by default. For details, see the lock function.
Constraints
Python scripts do not support script parameters or job parameters.
Procedure
- Log in to the DataArts Studio console. Locate an instance and click Access. On the displayed page, locate a workspace and click DataArts Factory.
Figure 1 DataArts Factory
- In the left navigation pane of DataArts Factory, choose .
- In the script directory list, double-click a script that you want to develop. The script development page is displayed.
- In the upper part of the editor, configure the host connection for executing the Python script.
- Edit Python statements in the editor. To facilitate script development, DataArts Factory provides the following capabilities:
- In the upper part of the editor, click Execute. After executing the Python statement, view the execution history and result of the script in the lower part of the editor.
You can perform the following operations on execution results:
- Double-click or right-click the name of an execution result tab to rename it. The name can contain a maximum of 16 characters.
- Right-click the name of an execution result tab to close the current tab, all the tabs to the left or right of the current tab, all the other tabs, or all the tabs.
- Above the editor, click
to save the script.If the script is created but not saved, set the parameters listed in
Table 1.
Table 1 Script parametersParameter
|
Mandatory
|
Description
|
Script Name
|
Yes
|
Name of the script. It contains a maximum of 128 characters. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed.
|
Description
|
No
|
Descriptive information about the script.
|
Select Directory
|
Yes
|
Directory to which the script belongs. The root directory is selected by default.
|