[Tutor] Question about global variables on modules

Alan Gauld alan.gauld at btinternet.com
Sat Apr 5 09:17:18 CEST 2008


"Tiago Katcipis" <katcipis at inf.ufsc.br> wrote

> results of a matrix using jacob. I want to inside the module (inside 
> a
> function on the module )assign a value to a global variable, but the
> only way i found to do this inside the own module function is 
> importing
> the module inside himself. Is there another way of doing this?

Look at the 'global' keyword.

Explained further in the 'What's in a Name' topic of my tutorial.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list