.py files in Studio within a Workflow. The execution path is similar to that of a Notebook task, but the file granularity is a single Python script, making it suitable for engineering scenarios such as modular code, script jobs, and Python package entry points.Dimension | Notebook task | Python File task |
File Type | .ipynb | .py |
Running Mode | Organized by cell and executed in order | Run entire file |
Scenario | Interactive development and ML experiments | Engineering scripts and production jobs |
Data Interaction Capability | Full DLCUtils module support | Full DLCUtils module support |
Resource mode | Distributed / Single-node | Distributed / Single-node |
Parameter | Description | Required |
Task Name | Unique within the same workflow. | Yes |
Task type | Python File. You can switch to other task types from the dropdown list. After switching, the parameter area will be cleared. | Yes |
Task Sources | Workspace / Git. | Yes |
Path | Path of the referenced .py file. | Yes |
.py files.Parameter | Description | Required | Default Value |
Computing Resource | Displays the compute resources bound to and available in the current workspace in a drop-down list. | Yes | None (User-Selected) |
Resource mode | Distributed / Single-node. | Yes | Resource mode of the file in Studio when the file is first configured; defaults to "Distributed" when the file is referenced from Git. |
Resource Configuration | Default configuration / Custom configuration (CPU mode). GPU configuration for Python File tasks is not available in this release. | Yes | Default Configuration |
Difference | Description |
GPU configuration | Python File tasks do not support GPU resource configuration. |
Basic environment | The workflow frontend does not have this configuration item. If it is already configured in Studio, the backend directly reuses it; otherwise, the default configuration is used. |
Dependency library | The workflow frontend does not have this configuration item. If it is already configured in Studio, it is reused; otherwise, it is submitted as empty. |
Source | Example |
Workspace | /Workspace/your_username/etl_pipeline.py |
Workspace (Git Folder) | /GitFolder/your_username/etl.py |
Git remote repository | scripts/etl/main.py |
python file.py. Variables are not retained after the run ends.dlcutils library is available in Python File tasks, and its behavior is consistent with that in Notebook.dlcutils.notebook.run in a Python file to trigger a Notebook?
Yes. Use the following in a Python file:result = dlcutils.notebook.run('/path/to/another.ipynb', 60)print(result)
.py files in the same directory or Git folder can be imported by using the standard import statement. For details, see "Step 3: Cross-File References" in Python IDE Basic Operations.피드백