[Mi...] Posted Monday at 06:07 PM Share Posted Monday at 06:07 PM I am attempting to create an application where I dynamically generate number of checkboxes (the number of checkboxes depends on the number of unique items in a text file). After which the user is required to type in a value. If the value entered is equal to the name assigned to one of the checkboxes, then the checkbox will be checked off. When I run this code, my dialog event handler does not understand that "fixtureDictionary['fixtureName_0']" must actually correspond to the value of 'T30' (as an example). Instead, it's explicitly looking for the variable named 'fixtureDictionary'. I am still a bit new to Python, and I am perplexed as to how to fix this I have been reading that it is generally bad practice to have dynamically named variables, but unfortunately every checkbox in my script is required to have a unique name. Is there anyway to pass the dialog."something".value a dynamic name? Or is there a different approach I should take? Link to comment Share on other sites More sharing options...
[Ja...] Posted 3 hours ago Share Posted 3 hours ago Can you give detail of your ultimate goal , maybe there is a different way round. Dynamic variable handling should be avoided in my experience, just gets messy and its not really geared to handle it When faced with issues that seemed to require this after research ive found dictionaries can be used quite well. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in