Re: [Tutor] main

2005-11-05 Thread bob
At 03:39 PM 11/5/2005, Shi Mu wrote: >It is very hard for me to understand why we need the following line? >if __name__ == "__main__": We don't need it. Often we code a module for importing into another module. But sometimes we also want to run the module independently as a Python program, perha

Re: [Tutor] Class attributes not overriding parameters

2005-11-05 Thread Liam Clarke
Hi Jan, Won't this site_id = property(GetSiteID, SetSiteID) and this site_id = 1 collide? On 11/6/05, Jan Eden <[EMAIL PROTECTED]> wrote: > Hi, > > I use the following construction to make sure the data attribute site_id is > set only once for each object: > > def GetSiteID(self): > retu

Re: [Tutor] main

2005-11-05 Thread Danny Yoo
On Sat, 5 Nov 2005, Shi Mu wrote: > It is very hard for me to understand why we need the following line? if > __name__ == "__main__": Hi Shi Mu, It's tied to the concept of modules. Have you learned about modules yet? Python programs can be split into several modular pieces, and these "modu

[Tutor] main

2005-11-05 Thread Shi Mu
It is very hard for me to understand why we need the following line? if __name__ == "__main__": ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] pack

2005-11-05 Thread Alan Gauld
Note: CC'ing tutor list to make reply visible to all. > i had to close PYTHONWIN to get out of the program. Aha! There are problems in running Tkinter inside both IDLE and Pythonwin. Basically both programs try to trap abnormal termination - which includes the GUI close messages... IMHO, to tes

Re: [Tutor] pack

2005-11-05 Thread bob
At 01:57 PM 11/5/2005, Shi Mu wrote: >when I clicked 'quit' button, >there is no response. I want to close the interface by clicking 'x', >the interface could not be closed. >i had to close PYTHONWIN to get out of the program. That is a known problem running Tkinter stuff under PythonWin. Others m

Re: [Tutor] pack

2005-11-05 Thread Shi Mu
when I clicked 'quit' button, there is no response. I want to close the interface by clicking 'x', the interface could not be closed. i had to close PYTHONWIN to get out of the program. On 11/5/05, Alan Gauld <[EMAIL PROTECTED]> wrote: > > Why the button of the following code does not work? Thank

[Tutor] Class attributes not overriding parameters

2005-11-05 Thread Jan Eden
Hi, I use the following construction to make sure the data attribute site_id is set only once for each object: def GetSiteID(self): return self._site_id def SetSiteID(self, value): if not (hasattr(self, '_site_id') and self._site_id): self._site_id = value site_id = property(GetSit

Re: [Tutor] pack

2005-11-05 Thread Alan Gauld
> Why the button of the following code does not work? Thanks! The program works perfectly for me. Which button do you think is not working? If its the Hello one where do you expect to see the output? print always prints to stdout so you need to look in the console window not on the GUI. But othe

Re: [Tutor] Is Python a good choise for this project?

2005-11-05 Thread Alan Gauld
> I'm in the process of chosing a technology for the implementation of a > system that will have a Map builder wich will allow the users to draw a > map > using several construction pieces. This map will then be used in the core > of the program where some pathfinding will be done - and then some