# How does input() work?

**URL:** <https://discourse.processing.org/t/how-does-input-work/34844>\
**Category:** Processing.py\
**Created:** [January 26, 2022, 4:35am UTC](https://discourse.processing.org/t/how-does-input-work/34844 "2022-01-26T04:35:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![btbamfan1](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@btbamfan1](https://discourse.processing.org/u/btbamfan1)\
**Post date:** [January 26, 2022, 4:35am UTC](https://discourse.processing.org/t/how-does-input-work/34844/1 "2022-01-26T04:35:12Z")

</div>

Hello everyone, when I use the input() function, then run it, where should I write my user input? Right now my code looks like this: `

def userInput():  
whereToGo = input(“Where would you like to go?”)

userInput()

`  
And when I run it, there is no where to put my input in the console. Can anyone help? Thanks

---

<div class="post-metadata">

**Author:** ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Post date:** [January 26, 2022, 7:05am UTC](https://discourse.processing.org/t/how-does-input-work/34844/2 "2022-01-26T07:05:57Z")

</div>

I don’t think the Processing console can capture input like that.

How about using something that employs `keyPressed()` and `text()` functions to render user input in the display window –

```python
def setup():
    size(300, 300)

where_to_go = ''

def draw():
    background(100)
    text('where would you like to go?', 20, 50)
    text(where_to_go, 20, 100)

def keyPressed():
    global where_to_go
    where_to_go += key

```

You can use a `if key == ENTER` within the `keyPressed()` function to detect when the user hits the enter key.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [January 26, 2022, 9:08pm UTC](https://discourse.processing.org/t/how-does-input-work/34844/3 "2022-01-26T21:08:49Z")

</div>

- [How to use input with (python) processing running on a mac ? - Processing 2.x and 3.x Forum](http://forum.Processing.org/two/discussion/23646/how-to-use-input-with-python-processing-running-on-a-mac.html)
