Send 1 data from Processing to Python that changes in void draw() loop (NEED HELP) – #2 by TfGuy44 – Coding Questions

Hi,
I’m new in Processing.
How can I send only 1 data from Processing to Python every time I use mousePressed == true, the data changes in void draw().
I tried and every time I press the mouse, the data that was sent to Python was a string of data sticks together…
For example, the data i would be: 1, then 2, then 3…, it changes in void draw() loop; then I press the mouse when the time at i=5, Python received: 12345.
Please give me some suggestions/ideas to handle this, which command I should use to delete the previous datas, I only need the last data when I press the mouse.
Thank you all!

Read more here: Source link