I want to write a web-based code generator for a Python crawler. Its aim is to automatically generate code so a developer doesn't need to write it, but I've run into this problem: in one of my project's webpages, there are some checkboxes, buttons, etc. Each of them generates some Python code and writes it to a common textarea. However, when I uncheck boxes I can't figure out how to remove the corresponding code from the textarea, because it's all been mixed together. For example:
Is there some way to fix this problem, or any better solution for the whole code generator project?
You need to separate out the idea of what code to generate from the events triggering generation.
What code is generated is governed by the combined set of all the checkboxes that are checked.
Triggering code generation occurs each time any of them are changed. You need to regenerate everything at that time.
In detail: