Note that there are some explanatory texts on larger screens.

plurals
  1. POusing entry from a class in another classes function
    primarykey
    data
    text
    <p>the variable function is given via the class functionframe. When trying to use it in add_function i get this error.</p> <blockquote> <p>AttributeError: class FunctionFrame has no attribute 'function'</p> </blockquote> <pre><code>class FunctionFrame(Frame): """a simple application to allow a user ti enter an expressio n and evaluate it """ def __init__(self, master): """ a a=simple expression evaluator """ Frame.__init__(self, master, relief=SUNKEN, bg='#A5A5A5', pady=3) Label(self, text='Function in x: ', bg='#A5A5A5').pack(side=LEFT) function = Entry(self, width=35).pack(side=LEFT, padx=2) Button(self, text='Select', command=self.select).pack(side=RIGHT, padx=4) colour = Entry(self, width=15).pack(side=RIGHT) Label(self, text='Function Colour: ', bg='#A5A5A5').pack(side=RIGHT, padx=2) def select(self): (rgb, hx)= askcolor() class ButtonFrame(Frame): """a simple application to allow a user ti enter an expression and evaluate it """ def __init__(self, master): """ a a=simple expression evaluator """ Frame.__init__(self, master, bg='#CECEF6') Button(self, text='Add Function', command=self.add_function).pack(side=LEFT) Button(self, text='Redraw All', command=self.redraw_all).pack(side=LEFT) Button(self, text='Remove Last Function', command=self.remove_last).pack(side=LEFT) Button(self, text='Remove All Functions', command=self.remove_all).pack(side=LEFT) Button(self, text='Exit', command=self.exit_app).pack(side=LEFT) def add_function(self): make_function(FunctionFrame.function) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload