Newbie: Why Does This Work This Way...Global Variables And The Signal Module....

Ignacio Vazquez-Abrams ignacio at openservices.net
Thu Sep 13 18:30:21 EDT 2001


On Thu, 13 Sep 2001, John Branthoover wrote:

>     I have written a simple program to break out of a endless loop by
> hitting control C,  see below.  This program works OK but I don't understand
> why I have to define the global variable "Loop_Run" twice to get it to work.
> I thought that you had only to define a global variable once at the
> beginning of a program and that made it available to rest of the module.

You haven't defined it twice; you have only told two different functions that
it is a global variable.

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>






More information about the Python-list mailing list