[Tutor] I get an error while search in my Entry field

2018-06-18 Thread Ali M
Hi, i get an error while searching my Entry field and i don't understand what that means. code: #! /usr/bin/env python3 #GeologyDict by Ali M import sqlite3 as sqlite import tkinter as tk from tkinter import Text from tkinter import Entry from tkinter import Scrollbar from tkinter import ttk #GU

[Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread C W
Dear Python experts, I never figured out when to call a method with parenthesis, when is it not? It seems inconsistent. For example, If I do > data.isnull() numberair_pressure_9amair_temp_9amavg_wind_direction_9amavg_wind_speed_9am max_wind_direction_9ammax_wind_speed_9amrain_accumulation_9am r

Re: [Tutor] I get an error while search in my Entry field

2018-06-18 Thread Alan Gauld via Tutor
On 17/06/18 23:59, Ali M wrote: > def update_list(self): > search_term = self.search_var.get() > self.listbox.delete(0, tk.END) > for item in self.listbox: The above pair of lines look odd. You delete everything on the listbox then try to iterate over it? Is that reall

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Alan Gauld via Tutor
On 17/06/18 19:02, C W wrote: > I never figured out when to call a method with parenthesis, when is it not? You call anything in Python (function, method, class, etc) using parentheses. The parentheses are what makes it a call. When you don't use parentheses you are referencing the callable objec

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Peter Otten
C W wrote: > Dear Python experts, > > I never figured out when to call a method with parenthesis, when is it > not? It seems inconsistent. > > For example, > If I do > >> data.isnull() > > numberair_pressure_9amair_temp_9amavg_wind_direction_9amavg_wind_speed_9am > max_wind_direction_9ammax_wi

Re: [Tutor] I get an error while search in my Entry field

2018-06-18 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 17/06/18 23:59, Ali M wrote: > >> def update_list(self): >> search_term = self.search_var.get() >> self.listbox.delete(0, tk.END) >> for item in self.listbox: > > The above pair of lines look odd. > You delete everything on the listbox

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Steven D'Aprano
On Sun, Jun 17, 2018 at 02:02:07PM -0400, C W wrote: > Dear Python experts, > > I never figured out when to call a method with parenthesis, when is it not? > It seems inconsistent. You *always* CALL a method (or function) with parentheses. But sometimes you can grab hold of a method (or function

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Steven D'Aprano
Another thought comes to mind... On Sun, Jun 17, 2018 at 02:02:07PM -0400, C W wrote: > Obviously, the second case does not make any senses. But, in data.columns, > it is only correct to do without parenthesis as below: > > > data.columns [...] > # with parenthesis throws an error > > data.colum

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Mats Wichmann
On 06/17/2018 12:02 PM, C W wrote: > Dear Python experts, > > I never figured out when to call a method with parenthesis, when is it not? > It seems inconsistent. > > For example, > If I do > >> data.isnull() > > numberair_pressure_9amair_temp_9amavg_wind_direction_9amavg_wind_speed_9am > max_w

[Tutor] Recursion

2018-06-18 Thread Roger Lea Scherer
My foggy understanding of recursion is probably the reason I can't figure this out. When turtle draws this program there is an orange line in the green which I would prefer not to have. I've tried all I could think of, but can't get the orange line to go away, or maybe more accurately, not to be dr

Re: [Tutor] Recursion

2018-06-18 Thread Alan Gauld via Tutor
On 18/06/18 23:12, Roger Lea Scherer wrote: > My foggy understanding of recursion is probably the reason I can't figure > this out. When turtle draws this program there is an orange line in the > green which I would prefer not to have. I've tried all I could think of, > but can't get the orange lin

Re: [Tutor] What's the difference between calling a method with parenthesis vs. without it?

2018-06-18 Thread Steven D'Aprano
On Mon, Jun 18, 2018 at 08:50:24AM -0600, Mats Wichmann wrote: > Python is not like certain other languages. But it is like *other* certain other languages. :-) Python's execution model is different from C, Pascal or Fortran, but it is quite similar to Ruby, Lua and Javascript. -- Steve __