# Send 1 data from Processing to Python that changes in void draw() loop (NEED HELP)

**URL:** <https://discourse.processing.org/t/send-1-data-from-processing-to-python-that-changes-in-void-draw-loop-need-help/35241>\
**Category:** Coding Questions\
**Created:** [February 17, 2022, 4:25pm UTC](https://discourse.processing.org/t/send-1-data-from-processing-to-python-that-changes-in-void-draw-loop-need-help/35241 "2022-02-17T16:25:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [February 18, 2022, 6:29am UTC](https://discourse.processing.org/t/send-1-data-from-processing-to-python-that-changes-in-void-draw-loop-need-help/35241/2 "2022-02-18T06:29:16Z")

</div>

Don’t use the `mousePressed` boolean. Instead, use the `mousepressed()` function.

The boolean is true if the mouse is pressed, which could be for several iterations of the draw() loop per click.

But the function only happens once per click, which sounds like exactly what you want.

```auto
void setup(){...}
void draw(){...}
void mousepressed(){
  send_data(i++);
}

```

---

_[View the full topic](https://discourse.processing.org/t/send-1-data-from-processing-to-python-that-changes-in-void-draw-loop-need-help/35241)._
