- Code: Select all
how to access local class ?
if __name__ == "__main__":
MyClass = return_a_class("Ow, the pain.")
an_instance = MyClass()
Describe the goal, not the step
If you are trying to find out how to do something (as opposed to reporting a bug), begin by describing the goal. Only then describe the particular step towards it that you are blocked on.
Often, people who need technical help have a high-level goal in mind and get stuck on what they think is one particular path towards the goal. They come for help with the step, but don't realize that the path is wrong. It can take substantial effort to get past this.
Stupid: How do I get the color-picker on the FooDraw program to take a hexadecimal RGB value?
Smart: I'm trying to replace the color table on an image with values of my choosing. Right now the only way I can see to do this is by editing each table slot, but I can't get FooDraw's color picker to take a hexadecimal RGB value.
The second version of the question is smart. It allows an answer that suggests a tool better suited to the task.
Users browsing this forum: No registered users and 5 guests