Re: [Tutor] question about import statement

2010-08-27 Thread Peter Otten
Greg Bair wrote: > On 08/26/2010 10:29 PM, Hugo Arts wrote: >> On Thu, Aug 26, 2010 at 9:16 PM, Bill Allen wrote: >>> >>> I did try that and of course it gave an error because it was necessary. >>> I >>> just did not know why. However, I later found an explanation on the >>> web. Here it is: >

Re: [Tutor] question about import statement

2010-08-27 Thread Alan Gauld
"Bill Allen" wrote *from tkinter import * from tkinter import ttk These two lines tell Python that our program needs two modules. The first, "tkinter", is the standard binding to Tk, which when loaded also causes the existing Tk library on your system to be loaded. The second, "ttk", is Py

Re: [Tutor] question about import statement

2010-08-26 Thread Steven D'Aprano
On Fri, 27 Aug 2010 02:18:10 pm Greg Bair wrote: > > yeah, "from package import *" doesn't actually import every name > > from a module. For example, by default, names starting with an > > underscore are not imported. Alternatively, if you have a variable > > named __all__ in your module, and it's

Re: [Tutor] question about import statement

2010-08-26 Thread Hugo Arts
On Thu, Aug 26, 2010 at 11:18 PM, Greg Bair wrote: > On 08/26/2010 10:29 PM, Hugo Arts wrote: >> On Thu, Aug 26, 2010 at 9:16 PM, Bill Allen wrote: >>> >>> I did try that and of course it gave an error because it was necessary.  I >>> just did not know why.   However, I later found an explanation

Re: [Tutor] question about import statement

2010-08-26 Thread Greg Bair
On 08/26/2010 10:29 PM, Hugo Arts wrote: > On Thu, Aug 26, 2010 at 9:16 PM, Bill Allen wrote: >> >> I did try that and of course it gave an error because it was necessary. I >> just did not know why. However, I later found an explanation on the web. >> Here it is: >> >> from tkinter import * >>

Re: [Tutor] question about import statement

2010-08-26 Thread Hugo Arts
On Thu, Aug 26, 2010 at 9:16 PM, Bill Allen wrote: > > I did try that and of course it gave an error because it was necessary.  I > just did not know why.   However, I later found an explanation on the web. > Here it is: > > from tkinter import * > from tkinter import ttk > > These two lines tell

Re: [Tutor] question about import statement

2010-08-26 Thread Bill Allen
> > On Thu, Aug 26, 2010 at 7:44 PM, Corey Richardson wrote: > >> Why don't you try it out without the "from tkinter import ttk" statement, >> and see if it works? >> >> Bill Allen wrote: >> >>> I was experimenting with Tk today, just trying it out. I found this >>> example of a very simple "hel

Re: [Tutor] question about import statement

2010-08-26 Thread Bill Allen
On Thu, Aug 26, 2010 at 7:44 PM, Corey Richardson wrote: > Why don't you try it out without the "from tkinter import ttk" statement, > and see if it works? > > Bill Allen wrote: > >> I was experimenting with Tk today, just trying it out. I found this >> example of a very simple "hello world" bu

[Tutor] question about import statement

2010-08-26 Thread Bill Allen
I was experimenting with Tk today, just trying it out. I found this example of a very simple "hello world" button click program. This is it. from tkinter import * from tkinter import ttk root = Tk() button = ttk.Button(root, text="Hello World").grid() root.mainloop() What I don't understand is