How to run the .py file in databricks cluster

data_engineer_0
New Contributor II

Hi team,

I wants to run the below command in databricks and also need to capture the error and success message.

Please help me out here,Thanks in advance

Ex: python3 /mnt/users/code/x.py --arguments

Hubert-Dudek
Databricks MVP

When you use repo you can enable "files in repo" and then just import class in notebook and init it.

from file_folder.file_name import your_class

c = your_class(arguments)


My blog: https://databrickster.medium.com/

Anonymous
Not applicable

@kalyan p​ - Did @Hubert Dudek​'s answer help solve the issue?

User16764241763
Databricks Employee
Databricks Employee