git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SyntaxError: positional argument follows keyword argument


On 6/7/2019 2:43 PM, Rich Shepard wrote:
> I understand positional and keyword arguments and the syntax for the
> ttk.Checkbutton as described on
> <https://www.tcl.tk/man/tcl/TkCmd/ttk_checkbutton.htm>.
> 
> $ python3 geochem.py
>  ? File "geochem.py", line 60
>  ??? ttk.Checkbutton(text='Censored?', variable=input_var),
>  ??? ^
> SyntaxError: positional argument follows keyword argument
> 
> I've provided only keyword arguments to the call to the ttk.Checkbutton
> widget and am not seeing the positional argument that follows. Please show
> me what I miss seeing here:
> 
> self.inputs['nondetect'] = LabelInput(
>  ??????????? self, 'Censored?',
>  ??????????? #input_var = tk.BooleanVar(),
>  ??????????? input_var = tk.IntVar,

An additional error is the missing ()s.  This would make input_var refer 
to the class, not an instance thereof.

>  ??????????? ttk.Checkbutton(text='Censored?', variable=input_var),
> )

-- 
Terry Jan Reedy