r/learnpython • u/RipEnvironmental7637 • Oct 16 '26
Values being added 10x instead of once
Hi I'm really new to python, I originally started coding using p5.js but made the transition recently, I'm currently trying to covert an old project of mine into python so I can run it in touch designer.
Its an ASL fingerspelling activity that I've been working on but I'm struggling to create the word strings I did in my original prototype. Instead of the letter that is being detected and averaged being added to my word string once it gets added 10 times all at once. For example if I sign the letter a, aaaaaaaaaa gets added to the string instead of just the lone a.
For context I have the guesser and getMostFrequent to allow for it to take the average of every letter signed during a period of time and determine which one was signed the most to add to the word (this is due to the fact that transitioning from one letter to the next can trigger other letters in between) These are both integral parts of the code and are working as intended, its just the multiplication of the letters that I'm struggling with.
This also may be due to the fact that this is running in TouchDesigner through a CHOP execute, if this isn't a python issue I can move my post to a touch designer specific forum.
Any help or insight would be appreciated, if you need any more insight please let me know and I can add it.
Code in Pastebin: https://pastebin.com/qkpzXkSY
View all comments
Show parent comment
2
u/Refwah Oct 16 '26
I’m just saying are you pressing ‘a’ once but it’s just adding ‘a’ to a list of ‘a’s that exist from previous runs?
I would recommend taking all of this code and using it as a Python console script first, so you know the core logic is sound, before you throw it into another framework. You have no idea if the bug is in your logic or in your interface with the framework.