cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
missing-QuestionPost
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

A simple Python command on Databricks selection = input("Enter value") doesn't create a window box to enter the value. Searching reasons on the User Interface or other?

chico
New Contributor II
 
3 REPLIES 3

User16539034020
Contributor II
Contributor II

Hi, Chico:

In Databricks notebooks, input() function calls won't work as you might expect from running Python in other environments. Because Databricks notebooks are using Spark. They're not intended to interact with users in real-time, such as taking keyboard inputs.

There is alternative way: Databricks has a feature called "widgets". Widgets are interactive HTML forms that can be embedded within Databricks notebooks. Here is the example:

dbutils.widgets.text("inputs", '{"name":"Monica, "company":"Databricks"}')
inputs = dbutils.widgets.get("inputs")

Reference doc: https://docs.databricks.com/dev-tools/databricks-utils.html

Hello

I should nave clarified: this a Pyspark environnment not just a Python one.

The issue relies in the cluster settings as taking an other one provides the expected outcome. What is sspecific in my initial cluter SFC ?

Thanks

Anonymous
Not applicable

Hi @stephane cochetโ€‹ 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.